[FIX] Bug: NOLINT, NOLINTNEXTLINE has no effect for "};".

This commit is contained in:
Piotr Semenov 2016-05-20 18:39:34 +03:00
parent 70d6b7d4b8
commit b7e2ef6de2

8
cpplint/cpplint.py vendored
View File

@ -3884,6 +3884,14 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
# outputting warnings for the matching closing brace, if there are # outputting warnings for the matching closing brace, if there are
# nested blocks with trailing semicolons, we will get the error # nested blocks with trailing semicolons, we will get the error
# messages in reversed order. # messages in reversed order.
# We need to check the line forward for NOLINT
raw_lines = clean_lines.raw_lines
ParseNolintSuppressions(filename, raw_lines[endlinenum-1], endlinenum-1,
error)
ParseNolintSuppressions(filename, raw_lines[endlinenum], endlinenum,
error)
error(filename, endlinenum, 'readability/braces', 4, error(filename, endlinenum, 'readability/braces', 4,
"You don't need a ; after a }") "You don't need a ; after a }")