Skip to content

Commit

Permalink
chore: use pylint-2.7 (#33232)
Browse files Browse the repository at this point in the history
* chore: use pylint-2.7

* chore: fix pylint errors
  • Loading branch information
dsanders11 committed Mar 23, 2022
1 parent 4633376 commit 27ddf19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion script/lint.js
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions script/release/uploaders/upload.py
Expand Up @@ -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)


Expand Down
5 changes: 5 additions & 0 deletions script/run-clang-format.py
Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 27ddf19

Please sign in to comment.