chore: fix pylint (#31138)
* chore: fix pylint * chore: fix linter errors
This commit is contained in:
parent
22d683e3f8
commit
2d111a4e25
6 changed files with 24 additions and 10 deletions
|
@ -29,8 +29,21 @@ const IS_WINDOWS = process.platform === 'win32';
|
|||
|
||||
function spawnAndCheckExitCode (cmd, args, opts) {
|
||||
opts = Object.assign({ stdio: 'inherit' }, opts);
|
||||
const status = childProcess.spawnSync(cmd, args, opts).status;
|
||||
if (status) process.exit(status);
|
||||
const { error, status, signal } = childProcess.spawnSync(cmd, args, opts);
|
||||
if (error) {
|
||||
// the subsprocess failed or timed out
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
if (status === null) {
|
||||
// the subprocess terminated due to a signal
|
||||
console.error(signal);
|
||||
process.exit(1);
|
||||
}
|
||||
if (status !== 0) {
|
||||
// `status` is an exit code
|
||||
process.exit(status);
|
||||
}
|
||||
}
|
||||
|
||||
function cpplint (args) {
|
||||
|
@ -91,7 +104,7 @@ const LINTERS = [{
|
|||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
|
||||
const args = ['--rcfile=' + rcfile, ...filenames];
|
||||
const env = Object.assign({ PYTHONPATH: path.join(SOURCE_ROOT, 'script') }, process.env);
|
||||
spawnAndCheckExitCode('pylint.py', args, { env });
|
||||
spawnAndCheckExitCode('pylint', args, { env });
|
||||
}
|
||||
}, {
|
||||
key: 'javascript',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue