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

Unified Diff: PRESUBMIT.py

Issue 1413263002: Changed the CheckBaseMacrosInHeaders presubmit to pass over C++ comments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 8d978fffe9649cf9a9c2d142254181b8281bf8b7..4eaee44c8db31cdefecddec6e2278c3156aa20f3 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1503,7 +1503,7 @@ def _CheckSingletonInHeaders(input_api, output_api):
f.LocalPath().endswith('.hpp') or f.LocalPath().endswith('.inl')):
contents = input_api.ReadFile(f)
for line in contents.splitlines(False):
- if (not input_api.re.match(r'//', line) and # Strip C++ comment.
+ if (not line.lstrip().startswith('//') and # Strip C++ comment.
pattern.search(line)):
files.append(f)
break
@@ -1529,6 +1529,8 @@ def _CheckBaseMacrosInHeaders(input_api, output_api):
if not f.LocalPath().endswith('.h'):
continue
for line_num, line in f.ChangedContents():
+ if line.lstrip().startswith('//'): # Strip C++ comment.
+ continue
if any(d in line for d in disallows):
contents = input_api.ReadFile(f)
if not (macros in contents or basictypes in contents):
« 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