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

Unified Diff: Tools/Scripts/webkitpy/style/checkers/cpp.py

Issue 872073003: check-webkit-style: Angle Bracket Parsing in Templates (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/style/checkers/cpp.py
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py
index fa274783d35f83943d4acb1f12217212d373f8b5..dbc6dc5b4e56aabb64a5bd1e5654973cfa40cc30 100644
--- a/Tools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1370,6 +1370,14 @@ def check_for_non_standard_constructs(clean_lines, line_number,
error(line_number, 'build/deprecated', 3,
'>? and <? (max and min) operators are non-standard and deprecated.')
+ if search(r'\w+<.*<.*>\s+>', line):
+ error(line_number, 'readability/templatebrackets', 3,
+ 'Use >> for ending template instead of > >.')
+
+ if search(r'\w+<\s+::\w+>', line):
+ error(line_number, 'readability/templatebrackets', 3,
+ 'Use <:: for template start instead of < ::.')
+
# Track class entry and exit, and attempt to find cases within the
# class declaration that don't meet the C++ style
# guidelines. Tracking is very dependent on the code matching Google
@@ -3999,6 +4007,7 @@ class CppChecker(object):
'readability/null',
'readability/pass_ptr',
'readability/streams',
+ 'readability/templatebrackets',
'readability/todo',
'readability/utf8',
'readability/webkit_export',
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698