Merge pull request #14690 from electron/lint-runner-support-cc-fix

Lint runner support cc fix
This commit is contained in:
John Kleinschmidt 2018-09-19 14:26:57 -04:00 committed by GitHub
commit 4f70f0e66a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,10 @@ const LINTERS = [ {
} }
} }
} }
if (result.status) process.exit(result.status) if (result.status) {
if (opts.fix) spawnAndCheckExitCode('python', ['script/run-clang-format.py', ...filenames])
process.exit(result.status)
}
} }
}, { }, {
key: 'python', key: 'python',
@ -98,7 +101,7 @@ function parseCommandLine () {
} }
async function findChangedFiles (top) { async function findChangedFiles (top) {
const result = await GitProcess.exec(['diff', 'HEAD', '--name-only'], top) const result = await GitProcess.exec(['diff', '--name-only', '--cached'], top)
if (result.exitCode !== 0) { if (result.exitCode !== 0) {
console.log('Failed to find changed files', GitProcess.parseError(result.stderr)) console.log('Failed to find changed files', GitProcess.parseError(result.stderr))
process.exit(1) process.exit(1)