tools: make C++ linter reject template<

This one is more or less just for me. :)

PR-URL: https://github.com/nodejs/node/pull/20675
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Anna Henningsen 2018-05-11 15:43:21 +02:00
parent bd6dc9ebab
commit fdfbf63973
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

4
tools/cpplint.py vendored
View File

@ -4230,6 +4230,10 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error(filename, linenum, 'whitespace/tab', 1, error(filename, linenum, 'whitespace/tab', 1,
'Tab found; better to use spaces') 'Tab found; better to use spaces')
if line.find('template<') != -1:
error(filename, linenum, 'whitespace/template', 1,
'Leave a single space after template, as in `template <...>`')
# One or three blank spaces at the beginning of the line is weird; it's # One or three blank spaces at the beginning of the line is weird; it's
# hard to reconcile that with 2-space indents. # hard to reconcile that with 2-space indents.
# NOTE: here are the conditions rob pike used for his tests. Mine aren't # NOTE: here are the conditions rob pike used for his tests. Mine aren't