Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: fixup to meet lint rules #1077

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');

module.exports = require('./common').runTest(test);

function test(binding) {
function test (binding) {
assert.strictEqual(binding.addon.increment(), 43);
assert.strictEqual(binding.addon.increment(), 44);
assert.strictEqual(binding.addon.subObject.decrement(), 43);
Expand Down
6 changes: 3 additions & 3 deletions test/addon_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = require('./common').runTestWithBindingPath(test);

// Make sure the instance data finalizer is called at process exit. If the hint
// is non-zero, it will be printed out by the child process.
function testFinalizer(bindingName, hint, expected) {
function testFinalizer (bindingName, hint, expected) {
return new Promise((resolve) => {
bindingName = bindingName.split('\\').join('\\\\');
const child = spawn(process.execPath, [
Expand All @@ -30,7 +30,7 @@ function testFinalizer(bindingName, hint, expected) {
});
}

async function test(bindingName) {
async function test (bindingName) {
const binding = require(bindingName).addon_data(0);

// Make sure it is possible to get/set instance data.
Expand All @@ -42,5 +42,5 @@ async function test(bindingName) {

await testFinalizer(bindingName, 0, ['addon_data: Addon::~Addon']);
await testFinalizer(bindingName, 42,
['addon_data: Addon::~Addon', 'hint: 42']);
['addon_data: Addon::~Addon', 'hint: 42']);
}
5 changes: 3 additions & 2 deletions tools/clang-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ const path = require('path');
const filesToCheck = ['*.h', '*.cc'];
const CLANG_FORMAT_START = process.env.CLANG_FORMAT_START || 'main';

function main(args) {
function main (args) {
let fix = false;
while (args.length > 0) {
switch (args[0]) {
case '-f':
case '--fix':
fix = true;
break;
default:
}
args.shift();
}

let clangFormatPath = path.dirname(require.resolve('clang-format'));
const clangFormatPath = path.dirname(require.resolve('clang-format'));
const options = ['--binary=node_modules/.bin/clang-format', '--style=file'];
if (fix) {
options.push(CLANG_FORMAT_START);
Expand Down