From dd4e93173008fd7f4be067faf67dbf2c7e40d220 Mon Sep 17 00:00:00 2001 From: "ilevy@chromium.org" Date: Tue, 15 Jan 2013 03:22:04 +0000 Subject: [PATCH] Fix pylint presubmit checks pylint checks were erronously excluded for PRESUBMIT.py files in root directory of repos because the regex was getting a './' added. R=iannucci@chromium.org TBR=M-A Review URL: https://chromiumcodereview.appspot.com/11880040 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@176777 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_canned_checks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 1e0d4c172..90c79ccfc 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -643,6 +643,9 @@ def RunPylint(input_api, output_api, white_list=None, black_list=None, # Only trigger if there is at least one python file affected. def rel_path(regex): """Modifies a regex for a subject to accept paths relative to root.""" + if input_api.os_path.samefile( + input_api.PresubmitLocalPath(), input_api.change.RepositoryRoot()): + return regex prefix = input_api.os_path.join(input_api.os_path.relpath( input_api.PresubmitLocalPath(), input_api.change.RepositoryRoot()), '') return input_api.re.escape(prefix) + regex