Skip to content

Commit

Permalink
doc: fixup to meet lint rules
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: nodejs/node-addon-api#1077
Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com>
  • Loading branch information
wroy7860 committed Sep 28, 2021
1 parent 7300d25 commit 633ee82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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

0 comments on commit 633ee82

Please sign in to comment.