Skip to content

Commit a43b862

Browse files
committed
Explore matching nested bracketed stuff
1 parent c8c9085 commit a43b862

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/cpplint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@
552552
"Missing space before {": r's/\([^ ]\){/\1 {/',
553553
"Tab found, replace by spaces": r's/\t/ /',
554554
"Line ends in whitespace. Consider deleting these extra spaces.": r's/\s*$//',
555-
#"Redundant blank line at the end of a code block should be deleted.": "d", # messes up line numbers for other errors.
555+
# "Statement after an if should be on a new line": r's/^\(\s*\)if *\(([^()]*)\) *\(.*\)$/\1if\2\n\1 \3/', # Single layer of nested bracets
556+
# "Statement after an if should be on a new line": r's/^\(\s*\)if *\((\([^()]\|([^()]*)\)*)\) *\(.*\)$/\1if\2\n\1 \4/', # Max 2 layers of nested bracets; messes up line numbers for other errors.
557+
# "Redundant blank line at the end of a code block should be deleted.": "d", # messes up line numbers for other errors.
556558
}
557559

558560
_regexp_compile_cache = {}

0 commit comments

Comments
 (0)