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:
parent
bd6dc9ebab
commit
fdfbf63973
4
tools/cpplint.py
vendored
4
tools/cpplint.py
vendored
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user