grunt-clang-format
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"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); | ||
}); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7066
106
1
+ Addedclang-format@1.8.0(transitive)
- Removedasync@1.5.2(transitive)
- Removedclang-format@1.0.53(transitive)
Updatedclang-format@^1.1.1