chore: fix pylint (#31138)

* chore: fix pylint

* chore: fix linter errors
This commit is contained in:
Alexey Kuzmin 2021-09-29 20:10:13 +03:00 committed by GitHub
parent 22d683e3f8
commit 2d111a4e25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 10 deletions

View file

@ -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',