diff options
author | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 12:18:27 +0000 |
---|---|---|
committer | marja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 12:18:27 +0000 |
commit | 2309b0fa040631b96018a23b0fc88d538e99ee74 (patch) | |
tree | 1826725c912a0cd3aa075795902b54638a66a76e /PRESUBMIT.py | |
parent | 5c38792fb45ba456bec05403eec4f518d4975b9b (diff) | |
download | chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.zip chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.tar.gz chromium_src-2309b0fa040631b96018a23b0fc88d538e99ee74.tar.bz2 |
Fix include order PRESUBMIT check: #if-#elif-#else
BUG=161390
Review URL: https://codereview.chromium.org/11413036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 6009243..2c6df72 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -559,8 +559,7 @@ def _CheckIncludeOrderInFile(input_api, f, is_source, changed_linenums): system_include_pattern = input_api.re.compile(r'\s*#include \<.*') custom_include_pattern = input_api.re.compile(r'\s*#include "(?P<FILE>.*)"') - if_pattern = input_api.re.compile(r'\s*#if.*') - endif_pattern = input_api.re.compile(r'\s*#endif.*') + if_pattern = input_api.re.compile(r'\s*#\s*(if|elif|else|endif).*') contents = f.NewContents() warnings = [] @@ -594,7 +593,7 @@ def _CheckIncludeOrderInFile(input_api, f, is_source, changed_linenums): current_scope = [] for line in contents[line_num:]: line_num += 1 - if if_pattern.match(line) or endif_pattern.match(line): + if if_pattern.match(line): scopes.append(current_scope) current_scope = [] elif (system_include_pattern.match(line) or @@ -654,8 +653,7 @@ def _CommonChecks(input_api, output_api): results.extend(_CheckUnwantedDependencies(input_api, output_api)) results.extend(_CheckFilePermissions(input_api, output_api)) results.extend(_CheckNoAuraWindowPropertyHInHeaders(input_api, output_api)) - # Causes a problem with content/renderer/render_view_impl.cc - #results.extend(_CheckIncludeOrder(input_api, output_api)) + results.extend(_CheckIncludeOrder(input_api, output_api)) if any('PRESUBMIT.py' == f.LocalPath() for f in input_api.AffectedFiles()): results.extend(input_api.canned_checks.RunUnitTestsInDirectory( |