Skip to content

Commit 44960a0

Browse files
committed
tools: make C++ linter reject template<
This one is more or less just for me. :) PR-URL: #20675 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 28b58b5 commit 44960a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/cpplint.py

+4
Original file line numberDiff line numberDiff line change
@@ -4230,6 +4230,10 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
42304230
error(filename, linenum, 'whitespace/tab', 1,
42314231
'Tab found; better to use spaces')
42324232

4233+
if line.find('template<') != -1:
4234+
error(filename, linenum, 'whitespace/template', 1,
4235+
'Leave a single space after template, as in `template <...>`')
4236+
42334237
# One or three blank spaces at the beginning of the line is weird; it's
42344238
# hard to reconcile that with 2-space indents.
42354239
# NOTE: here are the conditions rob pike used for his tests. Mine aren't

0 commit comments

Comments
 (0)