Revert "Fix the `cpplint.py` `build/endif_comment` check."
diff --git a/cpplint/cpplint.py b/cpplint/cpplint.py
index 8d30ed6..3366b39 100755
--- a/cpplint/cpplint.py
+++ b/cpplint/cpplint.py
@@ -2710,11 +2710,6 @@
filename, line number, error level, and message
"""
- line = clean_lines.lines_without_raw_strings[linenum]
- if Match(r'\s*#\s*endif\s*([^/\s]|/[^/]|$)', line):
- error(filename, linenum, 'build/endif_comment', 5,
- 'Uncommented text after #endif is non-standard. Use a comment.')
-
# Remove comments from the line, but leave in strings for now.
line = clean_lines.lines[linenum]
@@ -2745,6 +2740,10 @@
'Storage-class specifier (static, extern, typedef, etc) should be '
'at the beginning of the declaration.')
+ if Match(r'\s*#\s*endif\s*[^/\s]+', line):
+ error(filename, linenum, 'build/endif_comment', 5,
+ 'Uncommented text after #endif is non-standard. Use a comment.')
+
if Match(r'\s*class\s+(\w+\s*::\s*)+\w+\s*;', line):
error(filename, linenum, 'build/forward_decl', 5,
'Inner-style forward declarations are invalid. Remove this line.')