You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

node-addon-api

Package Overview
Dependencies
Maintainers
5
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.2.0 to 4.3.0

tools/eslint-format.js

26

package.json

@@ -15,2 +15,6 @@ {

{
"name": "Alexander Floh",
"url": "https://github.com/alexanderfloh"
},
{
"name": "András Timár, Dr",

@@ -92,2 +96,6 @@ "url": "https://github.com/timarandras"

{
"name": "Doni Rubiagatra",
"url": "https://github.com/rubiagatra"
},
{
"name": "Ferdinand Holzer",

@@ -317,2 +325,7 @@ "url": "https://github.com/fholzer"

{
"name": "WenheLI",
"url": "https://github.com/WenheLI"
},
{
"name": "Yohei Kishimoto",

@@ -335,2 +348,8 @@ "url": "https://github.com/morokosi"

"clang-format": "^1.4.0",
"eslint": "^7.32.0",
"eslint-config-semistandard": "^16.0.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"fs-extra": "^9.0.1",

@@ -358,3 +377,2 @@ "path": "^0.12.7",

"name": "node-addon-api",
"optionalDependencies": {},
"readme": "README.md",

@@ -380,8 +398,8 @@ "repository": {

"doc": "doxygen doc/Doxyfile",
"lint": "node tools/clang-format",
"lint:fix": "node tools/clang-format --fix"
"lint": "node tools/eslint-format && node tools/clang-format",
"lint:fix": "node tools/clang-format --fix && node tools/eslint-format --fix"
},
"pre-commit": "lint",
"version": "4.2.0",
"version": "4.3.0",
"support": true
}

2

README.md

@@ -73,3 +73,3 @@ NOTE: The default branch has been renamed!

## **Current version: 4.2.0**
## **Current version: 4.3.0**

@@ -76,0 +76,0 @@ (See [CHANGELOG.md](CHANGELOG.md) for complete Changelog)

@@ -7,5 +7,5 @@ #!/usr/bin/env node

const filesToCheck = ['*.h', '*.cc'];
const CLANG_FORMAT_START = process.env.CLANG_FORMAT_START || 'main';
const FORMAT_START = process.env.FORMAT_START || 'main';
function main(args) {
function main (args) {
let fix = false;

@@ -17,2 +17,3 @@ while (args.length > 0) {

fix = true;
break;
default:

@@ -23,18 +24,16 @@ }

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);
options.push(FORMAT_START);
} else {
options.push('--diff', CLANG_FORMAT_START);
options.push('--diff', FORMAT_START);
}
const gitClangFormatPath = path.join(clangFormatPath,
'bin/git-clang-format');
const result = spawn('python', [
gitClangFormatPath,
...options,
'--',
...filesToCheck
], { encoding: 'utf-8' });
const gitClangFormatPath = path.join(clangFormatPath, 'bin/git-clang-format');
const result = spawn(
'python',
[gitClangFormatPath, ...options, '--', ...filesToCheck],
{ encoding: 'utf-8' }
);

@@ -53,5 +52,7 @@ if (result.stderr) {

// Detect if there is any complains from clang-format
if (clangFormatOutput !== '' &&
clangFormatOutput !== ('no modified files to format') &&
clangFormatOutput !== ('clang-format did not modify any files')) {
if (
clangFormatOutput !== '' &&
clangFormatOutput !== 'no modified files to format' &&
clangFormatOutput !== 'clang-format did not modify any files'
) {
console.error(clangFormatOutput);

@@ -64,3 +65,3 @@ const fixCmd = 'npm run lint:fix';

to exclude un-related complains.
Or you can run "env CLANG_FORMAT_START=upstream/main ${fixCmd}".`);
Or you can run "env FORMAT_START=upstream/main ${fixCmd}".`);
return 1;

@@ -67,0 +68,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc