Skip to content

Commit 6f91c8e

Browse files
aduh95juanarbol
authored andcommitted
benchmark: add trailing commas
PR-URL: #46370 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 92f0747 commit 6f91c8e

File tree

83 files changed

+133
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+133
-115
lines changed

benchmark/.eslintrc.yaml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@ env:
55
es6: true
66

77
rules:
8-
comma-dangle: [error, {
9-
arrays: always-multiline,
10-
exports: always-multiline,
11-
functions: only-multiline,
12-
imports: always-multiline,
13-
objects: only-multiline,
14-
}]
158
prefer-arrow-callback: error
9+
10+
overrides:
11+
- files:
12+
- async_hooks/*.js
13+
- buffers/*.js
14+
- buffers-fill/*.js
15+
- crypto/*.js
16+
- fs/*.js
17+
- http/*.js
18+
- http2/*.js
19+
- misc/*.js
20+
- module/*.js
21+
- net/*.js
22+
- path/*.js
23+
- process/*.js
24+
- url/*.js
25+
- util/*.js
26+
rules:
27+
comma-dangle: [error, {
28+
arrays: always-multiline,
29+
exports: always-multiline,
30+
functions: only-multiline,
31+
imports: always-multiline,
32+
objects: only-multiline,
33+
}]

benchmark/_http-benchmarkers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class TestDoubleBenchmarker {
106106
const scheme = options.scheme || 'http';
107107
const env = {
108108
test_url: `${scheme}://127.0.0.1:${options.port}${options.path}`,
109-
...process.env
109+
...process.env,
110110
};
111111

112112
const child = child_process.fork(this.executable,
@@ -203,7 +203,7 @@ exports.run = function(options, callback) {
203203
connections: 100,
204204
duration: 5,
205205
benchmarker: exports.default_http_benchmarker,
206-
...options
206+
...options,
207207
};
208208
if (!options.benchmarker) {
209209
callback(new Error('Could not locate required http benchmarker. See ' +

benchmark/assert/deepequal-map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function main({ n, len, method, strict }) {
4646
}
4747
case 'deepEqual_mixed': {
4848
const values = array.map(
49-
(_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]
49+
(_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123],
5050
);
5151
benchmark(strict ? deepStrictEqual : deepEqual, n, values);
5252
break;
@@ -67,7 +67,7 @@ function main({ n, len, method, strict }) {
6767
}
6868
case 'notDeepEqual_mixed': {
6969
const values = array.map(
70-
(_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123]
70+
(_, i) => [i % 2 ? [`str_${i}`, 1] : `str_${i}`, 123],
7171
);
7272
const values2 = values.slice(0);
7373
values2[0] = ['w00t', 123];

benchmark/blob/blob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { Blob } = require('buffer');
55
const bench = common.createBenchmark(main, {
66
bytes: [128, 1024, 1024 ** 2],
77
n: [1e6],
8-
operation: ['text', 'arrayBuffer']
8+
operation: ['text', 'arrayBuffer'],
99
});
1010

1111
async function run(n, bytes, operation) {

benchmark/blob/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { File } = require('buffer');
55
const bench = common.createBenchmark(main, {
66
bytes: [128, 1024, 1024 ** 2],
77
n: [1e6],
8-
operation: ['text', 'arrayBuffer']
8+
operation: ['text', 'arrayBuffer'],
99
});
1010

1111
const options = {

benchmark/child_process/child-process-exec-stdout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (!isWindows) messagesLength.push(32768);
99

1010
const bench = common.createBenchmark(childProcessExecStdout, {
1111
len: messagesLength,
12-
dur: [5]
12+
dur: [5],
1313
});
1414

1515
function childProcessExecStdout({ dur, len }) {

benchmark/child_process/child-process-read-ipc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (process.argv[2] === 'child') {
1515
64, 256, 1024, 4096, 16384, 65536,
1616
65536 << 4, 65536 << 6 - 1,
1717
],
18-
dur: [5]
18+
dur: [5],
1919
});
2020
const spawn = require('child_process').spawn;
2121

benchmark/child_process/child-process-read.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (os.platform() !== 'win32')
1414

1515
const bench = common.createBenchmark(main, {
1616
len: messagesLength,
17-
dur: [5]
17+
dur: [5],
1818
});
1919

2020
function main({ dur, len }) {

benchmark/child_process/spawn-echo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22
const common = require('../common.js');
33
const bench = common.createBenchmark(main, {
4-
n: [1000]
4+
n: [1000],
55
});
66

77
const spawn = require('child_process').spawn;

benchmark/cluster/echo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ if (cluster.isMaster) {
88
payload: ['string', 'object'],
99
sendsPerBroadcast: [1, 10],
1010
serialization: ['json', 'advanced'],
11-
n: [1e5]
11+
n: [1e5],
1212
});
1313

1414
function main({
1515
n,
1616
workers,
1717
sendsPerBroadcast,
1818
payload,
19-
serialization
19+
serialization,
2020
}) {
2121
const expectedPerBroadcast = sendsPerBroadcast * workers;
2222
let readies = 0;

0 commit comments

Comments
 (0)