mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
tools,test: make argument linting more stringent
The custom linting rule for argument alignment in multi-line function calls previously ignored template strings in an effort to avoid false positives. This isn't really necessary. Enforce for template strings and adjust whitespace in three tests to abide. (Insert "The test abides" joke of your choosing here.) PR-URL: https://github.com/nodejs/node/pull/6720 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
6d1527bb37
commit
ceeae4b180
4 files changed
+16
-17
No files matched your search
@@ -376,7 +376,7 @@ try {
|
||||
} catch (e) {
|
||||
threw = true;
|
||||
assert(e instanceof AnotherErrorType,
|
||||
`expected AnotherErrorType, received ${e}`);
|
||||
`expected AnotherErrorType, received ${e}`);
|
||||
}
|
||||
|
||||
assert.ok(threw);
|
||||
|
||||
@@ -45,7 +45,7 @@ var notSocketClient = net.createConnection(emptyTxt, function() {
|
||||
|
||||
notSocketClient.on('error', function(err) {
|
||||
assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED',
|
||||
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
|
||||
`received ${err.code} instead of ENOTSOCK or ECONNREFUSED`);
|
||||
notSocketErrorFired = true;
|
||||
});
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ process.chdir(common.tmpDir);
|
||||
// Unknown checked for to prevent flakiness, if pattern is not found,
|
||||
// then a large number of unknown ticks should be present
|
||||
runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/,
|
||||
`function f() {
|
||||
for (var i = 0; i < 1000000; i++) {
|
||||
i++;
|
||||
}
|
||||
setImmediate(function() { f(); });
|
||||
};
|
||||
setTimeout(function() { process.exit(0); }, 2000);
|
||||
f();`);
|
||||
`function f() {
|
||||
for (var i = 0; i < 1000000; i++) {
|
||||
i++;
|
||||
}
|
||||
setImmediate(function() { f(); });
|
||||
};
|
||||
setTimeout(function() { process.exit(0); }, 2000);
|
||||
f();`);
|
||||
if (common.isWindows ||
|
||||
common.isSunOS ||
|
||||
common.isAix ||
|
||||
@@ -36,12 +36,12 @@ if (common.isWindows ||
|
||||
return;
|
||||
}
|
||||
runTest(/RunInDebugContext/,
|
||||
`function f() {
|
||||
require(\'vm\').runInDebugContext(\'Debug\');
|
||||
setImmediate(function() { f(); });
|
||||
};
|
||||
setTimeout(function() { process.exit(0); }, 2000);
|
||||
f();`);
|
||||
`function f() {
|
||||
require(\'vm\').runInDebugContext(\'Debug\');
|
||||
setImmediate(function() { f(); });
|
||||
};
|
||||
setTimeout(function() { process.exit(0); }, 2000);
|
||||
f();`);
|
||||
|
||||
function runTest(pattern, code) {
|
||||
cp.execFileSync(process.execPath, ['-prof', '-pe', code]);
|
||||
|
||||
@@ -33,7 +33,6 @@ function checkArgumentAlignment(context, node) {
|
||||
'CallExpression',
|
||||
'FunctionExpression',
|
||||
'ObjectExpression',
|
||||
'TemplateLiteral'
|
||||
];
|
||||
|
||||
const args = node.arguments;
|
||||
|
||||
Reference in new issue
Block a user