Skip to content

Commit f2ced93

Browse files
committed
[FIX] Bug: NOLINT, NOLINTNEXTLINE has no effect if used for the closing-brace line "};" in the lambda declaration.
1 parent 70d6b7d commit f2ced93

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cpplint/cpplint.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,6 +3884,14 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
38843884
# outputting warnings for the matching closing brace, if there are
38853885
# nested blocks with trailing semicolons, we will get the error
38863886
# messages in reversed order.
3887+
3888+
# We need to check the line forward for NOLINT
3889+
raw_lines = clean_lines.raw_lines
3890+
ParseNolintSuppressions(filename, raw_lines[endlinenum-1], endlinenum-1,
3891+
error)
3892+
ParseNolintSuppressions(filename, raw_lines[endlinenum], endlinenum,
3893+
error)
3894+
38873895
error(filename, endlinenum, 'readability/braces', 4,
38883896
"You don't need a ; after a }")
38893897

0 commit comments

Comments
 (0)