Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-clang-format

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-clang-format - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"name": "grunt-clang-format",
"description": "Format your objective-c code using the clang-format tool",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/appcelerator/grunt-clang-format",

@@ -31,3 +31,3 @@ "author": {

"async": "^2.5.0",
"clang-format": "1.0.53"
"clang-format": "^1.1.1"
},

@@ -34,0 +34,0 @@ "devDependencies": {

@@ -13,2 +13,3 @@ /*

clangFormat = require('clang-format'),
fork = require('child_process').fork, // eslint-disable-line security/detect-child-process
EXEC_LIMIT = 10;

@@ -40,15 +41,24 @@

// Format the files in parallel, but limit number of simultaneous execs or we'll fail
async.mapLimit(src, EXEC_LIMIT, function (filepath, cb) {
grunt.log.debug(filepath);
clangFormat.spawnClangFormat([ '-i', filepath ], function (exit) {
async.eachLimit(src, EXEC_LIMIT, function (filepath, cb) {
let stdout = '';
let stderr = '';
const proc = fork(clangFormat.location, [ '-style=file', '-i', filepath ], { silent: true, cwd: process.cwd() });
proc.stdout.on('data', function (data) {
stdout += data.toString();
});
proc.stderr.on('data', function (data) {
stderr += data.toString();
});
proc.on('close', function (exit) {
if (exit) {
grunt.fail.fatal('Failed to format "' + filepath + '"');
cb(exit);
const msg = `Failed to check formatting of ${filepath}. Exit code: ${exit}, stdout: ${stdout}, stderr: ${stderr}`;
return cb(new Error(msg));
}
// Print a success message.
grunt.log.ok('Formatted "' + filepath + '"');
cb();
}, [ 'ignore', 'pipe', process.stderr ]);
});
}, done);
});
};
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc