Commit 26e2c94c authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Issue warnings when running pylint-1.5

Tested manually since we have no unit tests that cover this bit.

R=gavinmak@google.com

Bug: 1105747
Change-Id: I113e27236ed450490e59df9a6f698925ff556bc7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3685350Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 94d0c0e6
......@@ -1103,28 +1103,24 @@ def GetPylint(input_api,
message=error_type,
python3=not python2)
# Always run pylint and pass it all the py files at once.
# Passing py files one at time is slower and can produce
# different results. input_api.verbose used to be used
# to enable this behaviour but differing behaviour in
# verbose mode is not desirable.
# Leave this unreachable code in here so users can make
# a quick local edit to diagnose pylint issues more
# easily.
if True:
# pylint's cycle detection doesn't work in parallel, so spawn a second,
# single-threaded job for just that check.
# Some PRESUBMITs explicitly mention cycle detection.
if not any('R0401' in a or 'cyclic-import' in a for a in extra_args):
return [
GetPylintCmd(files, ["--disable=cyclic-import"], True),
GetPylintCmd(files, ["--disable=all", "--enable=cyclic-import"], False)
]
return [ GetPylintCmd(files, [], True) ]
# pylint's cycle detection doesn't work in parallel, so spawn a second,
# single-threaded job for just that check.
# Some PRESUBMITs explicitly mention cycle detection.
if not any('R0401' in a or 'cyclic-import' in a for a in extra_args):
tests = [
GetPylintCmd(files, ["--disable=cyclic-import"], True),
GetPylintCmd(files, ["--disable=all", "--enable=cyclic-import"], False),
]
else:
tests = [
GetPylintCmd(files, [], True),
]
if version == '1.5':
# Warn users about pylint-1.5 deprecation
tests.append(output_api.PresubmitPromptWarning(
'pylint-1.5 is deprecated, please switch to 2.7 before 2022-07-11'))
return map(lambda x: GetPylintCmd([x], [], 1), files)
return tests
def RunPylint(input_api, *args, **kwargs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment