diff options
author | binji <binji@chromium.org> | 2014-12-12 10:32:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-12 18:33:25 +0000 |
commit | 0dcdf34d61c72798ad8949882efa2a42bf391cf3 (patch) | |
tree | 241a4931769b542d7e17be4765b053eab003e655 | |
parent | decf4361cef158c83e2b88369c5f25ab7154bc25 (diff) | |
download | chromium_src-0dcdf34d61c72798ad8949882efa2a42bf391cf3.zip chromium_src-0dcdf34d61c72798ad8949882efa2a42bf391cf3.tar.gz chromium_src-0dcdf34d61c72798ad8949882efa2a42bf391cf3.tar.bz2 |
Remove native_client_sdk from the PNG presubmit check
The native_client_sdk directory contains auto-generated documentation that
includes PNGs that are flagged by the presubmit check. These PNGs are not used
by Chrome, so they should be ignored by the check.
BUG=150046
R=phajdan.jr@chromium.org
Review URL: https://codereview.chromium.org/802463002
Cr-Commit-Position: refs/heads/master@{#308125}
-rw-r--r-- | PRESUBMIT.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index c875e48..d63fa42 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -862,12 +862,17 @@ def _CheckHardcodedGoogleHostsInLowerLayers(input_api, output_api): def _CheckNoAbbreviationInPngFileName(input_api, output_api): """Makes sure there are no abbreviations in the name of PNG files. + The native_client_sdk directory is excluded because it has auto-generated PNG + files for documentation. """ - pattern = input_api.re.compile(r'.*_[a-z]_.*\.png$|.*_[a-z]\.png$') errors = [] - for f in input_api.AffectedFiles(include_deletes=False): - if pattern.match(f.LocalPath()): - errors.append(' %s' % f.LocalPath()) + white_list = (r'.*_[a-z]_.*\.png$|.*_[a-z]\.png$',) + black_list = (r'^native_client_sdk[\\\/]',) + file_filter = lambda f: input_api.FilterSourceFile( + f, white_list=white_list, black_list=black_list) + for f in input_api.AffectedFiles(include_deletes=False, + file_filter=file_filter): + errors.append(' %s' % f.LocalPath()) results = [] if errors: |