chore: use pylint-2.7 (#33232)

* chore: use pylint-2.7

* chore: fix pylint errors
This commit is contained in:
David Sanders 2022-03-22 17:17:35 -07:00 committed by GitHub
parent 4633376b28
commit 27ddf19f3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -103,7 +103,7 @@ const LINTERS = [{
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
const args = ['--rcfile=' + rcfile, ...filenames];
const env = Object.assign({ PYTHONPATH: path.join(ELECTRON_ROOT, 'script') }, process.env);
spawnAndCheckExitCode('pylint', args, { env });
spawnAndCheckExitCode('pylint-2.7', args, { env });
}
}, {
key: 'javascript',

View file

@ -208,6 +208,7 @@ def zero_zip_date_time(fname):
with open(fname, 'r+b') as f:
_zero_zip_date_time(f)
except Exception:
# pylint: disable=W0707
raise NonZipFileError(fname)

View file

@ -78,12 +78,14 @@ def make_diff(diff_file, original, reformatted):
class DiffError(Exception):
def __init__(self, message, errs=None):
# pylint: disable=R1725
super(DiffError, self).__init__(message)
self.errs = errs or []
class UnexpectedError(Exception):
def __init__(self, message, exc=None):
# pylint: disable=R1725
super(UnexpectedError, self).__init__(message)
self.formatted_traceback = traceback.format_exc()
self.exc = exc
@ -96,6 +98,7 @@ def run_clang_format_diff_wrapper(args, file_name):
except DiffError:
raise
except Exception as e:
# pylint: disable=W0707
raise UnexpectedError('{}: {}: {}'.format(
file_name, e.__class__.__name__, e), e)
@ -105,6 +108,7 @@ def run_clang_format_diff(args, file_name):
with io.open(file_name, 'r', encoding='utf-8') as f:
original = f.readlines()
except IOError as exc:
# pylint: disable=W0707
raise DiffError(str(exc))
invocation = [args.clang_format_executable, file_name]
if args.fix:
@ -117,6 +121,7 @@ def run_clang_format_diff(args, file_name):
universal_newlines=True,
shell=True)
except OSError as exc:
# pylint: disable=W0707
raise DiffError(str(exc))
proc_stdout = proc.stdout
proc_stderr = proc.stderr