From 44960a0d5acb64c9aeef9f6d8089adc3b16e46da Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 11 May 2018 15:43:21 +0200 Subject: [PATCH] tools: make C++ linter reject `template<` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This one is more or less just for me. :) PR-URL: https://github.com/nodejs/node/pull/20675 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Gus Caplan Reviewed-By: Tobias Nießen Reviewed-By: Tiancheng "Timothy" Gu Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Daniel Bevenius Reviewed-By: Ruben Bridgewater --- tools/cpplint.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/cpplint.py b/tools/cpplint.py index 460c1ecbfeb02f..ee103ef7161ba1 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