diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-14 17:54:14 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-14 17:54:14 +0000 |
commit | 2b438d6514d5e842eb29d4d285f45701a8fb063c (patch) | |
tree | 7edbe43801aa28405493dc186467b1534134bea2 /PRESUBMIT.py | |
parent | 8d3dcadf9f440e7c71031fabaae3c8e8da74657a (diff) | |
download | chromium_src-2b438d6514d5e842eb29d4d285f45701a8fb063c.zip chromium_src-2b438d6514d5e842eb29d4d285f45701a8fb063c.tar.gz chromium_src-2b438d6514d5e842eb29d4d285f45701a8fb063c.tar.bz2 |
Ignore jni/ paths in _CheckAddedDepsHaveTargetApprovals presubmit check.
Improve the implementation so it's easy to add other such directories if/when needed.
BUG=none
Review URL: https://codereview.chromium.org/72763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 5f2a11b..2836a98 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -746,7 +746,8 @@ def _CheckNoAbbreviationInPngFileName(input_api, output_api): def _DepsFilesToCheck(re, changed_lines): """Helper method for _CheckAddedDepsHaveTargetApprovals. Returns a set of DEPS entries that we should look up.""" - results = set() + # We ignore deps entries on auto-generated directories. + AUTO_GENERATED_DIRS = ['grit', 'jni'] # This pattern grabs the path without basename in the first # parentheses, and the basename (if present) in the second. It @@ -754,11 +755,12 @@ def _DepsFilesToCheck(re, changed_lines): # be a header file ending in ".h". pattern = re.compile( r"""['"]\+([^'"]+?)(/[a-zA-Z0-9_]+\.h)?['"].*""") + results = set() for changed_line in changed_lines: m = pattern.match(changed_line) if m: path = m.group(1) - if not (path.startswith('grit/') or path == 'grit'): + if path.split('/')[0] not in AUTO_GENERATED_DIRS: results.add('%s/DEPS' % m.group(1)) return results |