From 89b222dba5ea3fd91598e821c0b82797f2e2fa3c Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Sat, 4 Jun 2022 00:21:08 +0000 Subject: [PATCH] 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 Commit-Queue: Bruce Dawson --- presubmit_canned_checks.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 8b3ea77720..a0b581f314 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -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