diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-05-11 15:43:21 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-05-14 18:09:24 +0200 |
commit | fdfbf63973491614ea4691b799d41af4dd6f3300 (patch) | |
tree | 7faae69af2162e1baedde933c6266ae337048773 /tools | |
parent | bd6dc9ebab058be28f59de33e05e036c91951ba6 (diff) | |
download | android-node-v8-fdfbf63973491614ea4691b799d41af4dd6f3300.tar.gz android-node-v8-fdfbf63973491614ea4691b799d41af4dd6f3300.tar.bz2 android-node-v8-fdfbf63973491614ea4691b799d41af4dd6f3300.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/cpplint.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/cpplint.py b/tools/cpplint.py index 460c1ecbfe..ee103ef716 100644 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -4230,6 +4230,10 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, error(filename, linenum, 'whitespace/tab', 1, '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 # hard to reconcile that with 2-space indents. # NOTE: here are the conditions rob pike used for his tests. Mine aren't |