Skip to content

Commit 1d07727

Browse files
committed
[src] [test] addressed linter issues from CI
1 parent 8b59d69 commit 1d07727

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/node_file.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,15 +1685,15 @@ static void RmSync(const FunctionCallbackInfo<Value>& args) {
16851685
int maxRetries = args[1].As<Int32>()->Value();
16861686
int recursive = args[2]->IsTrue();
16871687
int retryDelay = args[3].As<Int32>()->Value();
1688-
1688+
16891689
auto file_path_as_str = PathToString(file_path);
16901690

16911691
// File is a directory and recursive is false
16921692
if (file_status.type() == std::filesystem::file_type::directory &&
16931693
!recursive) {
16941694
return THROW_ERR_FS_EISDIR(
16951695
isolate, "Path is a directory: %s", file_path_as_str);
1696-
}
1696+
}
16971697

16981698
// Allowed errors are:
16991699
// - EBUSY: std::errc::device_or_resource_busy

test/parallel/test-fs-rmSync-special-char.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const assert = require('node:assert');
55
const fs = require('node:fs');
66
const path = require('node:path');
77

8-
// This test ensures that fs.rmSync handles UTF-8 characters in file paths,
8+
// This test ensures that fs.rmSync handles non-ASCII characters in file paths,
99
// and that errors contain correctly encoded paths and err.path values.
1010

1111
tmpdir.refresh(); // Prepare a clean temporary directory
@@ -24,13 +24,13 @@ fs.rmSync(filePath);
2424
// Ensure the file has been removed
2525
assert.strictEqual(fs.existsSync(filePath), false);
2626

27-
// // Ensure rmSync throws an error when trying to remove a directory without recursive
27+
// Ensure rmSync throws an error when trying to remove a directory without recursive
2828
assert.throws(() => {
2929
fs.rmSync(dirPath, { recursive: false });
3030
}, (err) => {
31-
// Assert the error message includes the correct non-ASCII path
31+
// Assert the error code and check that the error message includes the correct non-ASCII path
3232
assert.strictEqual(err.code, 'ERR_FS_EISDIR');
3333
assert(err.message.includes(dirPath), 'Error message should include the directory path');
34-
assert.strictEqual(err.path, dirPath, 'err.path should match the non-ASCII directory path');
35-
return true; // Indicate the validation function passed
34+
assert.strictEqual(err.path, dirPath);
35+
return true;
3636
});

0 commit comments

Comments
 (0)