Skip to content

Commit e36f44f

Browse files
karkhaztautschnig
authored andcommitted
Don't lint text between #if 0...#endif
1 parent 18d0d7b commit e36f44f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/cpplint.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,8 @@ def CleanseRawStrings(raw_lines):
13771377
def FindNextMultiLineCommentStart(lines, lineix):
13781378
"""Find the beginning marker for a multiline comment."""
13791379
while lineix < len(lines):
1380-
if lines[lineix].strip().startswith('/*'):
1380+
if (lines[lineix].strip().startswith('/*') or
1381+
lines[lineix].strip().startswith('#if 0')):
13811382
# Only return this marker if the comment goes beyond this line
13821383
if lines[lineix].strip().find('*/', 2) < 0:
13831384
return lineix
@@ -1388,7 +1389,8 @@ def FindNextMultiLineCommentStart(lines, lineix):
13881389
def FindNextMultiLineCommentEnd(lines, lineix):
13891390
"""We are inside a comment, find the end marker."""
13901391
while lineix < len(lines):
1391-
if lines[lineix].strip().endswith('*/'):
1392+
if (lines[lineix].strip().endswith('*/') or
1393+
lines[lineix].strip().endswith('#endif')):
13921394
return lineix
13931395
lineix += 1
13941396
return len(lines)

0 commit comments

Comments
 (0)