Print full path and upgrade details in PyLint warning

A run of "git cl presubmit --all" shows that PyLint 1.5 is being run
from nine locations, however the deprecation warnings don't say where.
This makes it difficult to file bugs or fix the remaining instances.
This changes the message to list the path to the presubmit that is
running PyLint 1.5.

This also adds instructions on how to change to version 2.7.

Before:

  pylint-1.5 is deprecated, please switch to 2.7 before 2022-07-11

After (with word wrapping):

  pylint-1.5 is being run on ...src\tools\find_runtime_symbols
  and is deprecated, please switch to 2.7 before 2022-07-11 (add
  version='2.7' to RunPylint call)

Change-Id: Iece2cb904f5d26ad66e3ab78f7ce7aef1878bfd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3688839
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/39/3688839/2
Bruce Dawson 3 years ago committed by LUCI CQ
parent 35ef5ada1d
commit 89b222dba5

@ -1117,8 +1117,11 @@ def GetPylint(input_api,
]
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'))
tests.append(
output_api.PresubmitPromptWarning(
'pylint-1.5 is being run on %s and is deprecated, please switch '
'to 2.7 before 2022-07-11 (add version=\'2.7\' to RunPylint call)'
% input_api.PresubmitLocalPath()))
return tests

Loading…
Cancel
Save