Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: PRESUBMIT.py

Issue 1309283003: Fix presubmit script for .cc files which include system files first. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made test use windows.h which is the more realistic case Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 7cbfa4474df12fa36aa647673531da79d4d6652f..5616d94fd3f34d8a066fc34e5db97bd698e46211 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -690,7 +690,6 @@ def _CheckIncludeOrderForScope(scope, input_api, file_path, changed_linenums):
2. C++ system files in alphabetical order
3. Project's .h files
"""
-
c_system_include_pattern = input_api.re.compile(r'\s*#include <.*\.h>')
cpp_system_include_pattern = input_api.re.compile(r'\s*#include <.*>')
custom_include_pattern = input_api.re.compile(r'\s*#include ".*')
@@ -775,6 +774,8 @@ def _CheckIncludeOrderInFile(input_api, f, changed_linenums):
for line in contents:
line_num += 1
+ if uncheckable_includes_pattern.match(line):
+ continue
if system_include_pattern.match(line):
# No special first include -> process the line again along with normal
# includes.
« no previous file with comments | « no previous file | PRESUBMIT_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698