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
experimental/szager/collated-output
ilevy@chromium.org 13 years ago
parent 36576334f3
commit dd4e931730

@ -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

Loading…
Cancel
Save