Skip to content

Commit 53df567

Browse files
committed
[path explore 6/7] cpplint & clang-fmt agree on :
cpplint now complains if a derived-class declaration is formatted as class derived: base rather than complaining if it is formatted as class derived : base (with a space on both sides of the colon). The latter style is the one enforced by clang-format, meaning that the two linters were inconsistent.
1 parent e8eec2c commit 53df567

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/cpplint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3625,8 +3625,8 @@ def CheckOperatorSpacing(filename, clean_lines, linenum, error):
36253625
# 'Remove spaces around %s' % match.group(0))
36263626

36273627
# check any inherited classes don't have a space between the type and the :
3628-
if Search(r'(struct|class)\s[\w_]*\s+:', line):
3629-
error(filename, linenum, 'readability/identifier_spacing', 4, 'There shouldn\'t be a space between class identifier and :')
3628+
if Search(r'(struct|class)\s[\w_]*:', line):
3629+
error(filename, linenum, 'readability/identifier_spacing', 4, 'There should be a space between class identifier and :')
36303630

36313631
#check type definitions end with t
36323632
# Look for class declarations and check the final character is a t

0 commit comments

Comments
 (0)