Skip to content

Commit d9c138a

Browse files
Renable enforcement of override without virtual
1 parent b5dec9c commit d9c138a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

scripts/cpplint.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -6136,21 +6136,21 @@ def CheckRedundantVirtual(filename, clean_lines, linenum, error):
61366136
if end_col < 0:
61376137
return # Couldn't find end of parameter list, give up
61386138

6139-
# # Look for "override" or "final" after the parameter list
6140-
# # (possibly on the next few lines).
6141-
# for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())):
6142-
# line = clean_lines.elided[i][end_col:]
6143-
# match = Search(r'\b(override|final)\b', line)
6144-
# if match:
6145-
# error(filename, linenum, 'readability/inheritance', 4,
6146-
# ('"virtual" is redundant since function is '
6147-
# 'already declared as "%s"' % match.group(1)))
6148-
#
6149-
# # Set end_col to check whole lines after we are done with the
6150-
# # first line.
6151-
# end_col = 0
6152-
# if Search(r'[^\w]\s*$', line):
6153-
# break
6139+
# Look for "override" or "final" after the parameter list
6140+
# (possibly on the next few lines).
6141+
for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())):
6142+
line = clean_lines.elided[i][end_col:]
6143+
match = Search(r'\b(override|final)\b', line)
6144+
if match:
6145+
error(filename, linenum, 'readability/inheritance', 4,
6146+
('"virtual" is redundant since function is '
6147+
'already declared as "%s"' % match.group(1)))
6148+
6149+
# Set end_col to check whole lines after we are done with the
6150+
# first line.
6151+
end_col = 0
6152+
if Search(r'[^\w]\s*$', line):
6153+
break
61546154

61556155

61566156

0 commit comments

Comments
 (0)