diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 05:24:05 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 05:24:05 +0000 |
commit | 19e77fd71c503b4476b773f1ecd5e4c85da744c4 (patch) | |
tree | a51b282afb5f96466da1a535a9c6f3243df3c723 /PRESUBMIT.py | |
parent | e29a92a9dfe2099026b0fee11bc71d533cc19691 (diff) | |
download | chromium_src-19e77fd71c503b4476b773f1ecd5e4c85da744c4.zip chromium_src-19e77fd71c503b4476b773f1ecd5e4c85da744c4.tar.gz chromium_src-19e77fd71c503b4476b773f1ecd5e4c85da744c4.tar.bz2 |
Add a couple of things to the whitelist as requested. Refactor.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8355017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106455 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index fe7f79c..27f03a9 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -48,10 +48,17 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): # calls to such functions without a proper C++ parser. source_extensions = r'\.(cc|cpp|cxx|mm)$' file_inclusion_pattern = r'.+%s' % source_extensions - file_exclusion_pattern = ( - r'(.*/(test_|mock_).+|.+(_test_support|profile_sync_service_harness|' - r'_(api|browser|perf|unit|ui)?test))%s' % source_extensions) - path_exclusion_pattern = r'.*[/\\](test|tool(s)?)[/\\].*' + file_exclusion_patterns = ( + r'.*/(test_|mock_).+%s' % source_extensions, + r'.+_test_(support|base)%s' % source_extensions, + r'.+_(api|browser|perf|unit|ui)?test%s' % source_extensions, + r'.+profile_sync_service_harness%s' % source_extensions, + ) + path_exclusion_patterns = ( + r'.*[/\\](test|tool(s)?)[/\\].*', + # At request of folks maintaining this folder. + r'chrome[/\\]browser[/\\]automation[/\\].*', + ) base_function_pattern = r'ForTest(ing)?|for_test(ing)?' inclusion_pattern = input_api.re.compile(r'(%s)\s*\(' % base_function_pattern) @@ -60,7 +67,7 @@ def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api): base_function_pattern, base_function_pattern)) def FilterFile(affected_file): - black_list = ((file_exclusion_pattern, path_exclusion_pattern, ) + + black_list = (file_exclusion_patterns + path_exclusion_patterns + _EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST) return input_api.FilterSourceFile( affected_file, |