Skip to content

Instantly share code, notes, and snippets.

@pansila
Created September 7, 2018 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pansila/15f5cac6b98000b578a735dad87cf2fb to your computer and use it in GitHub Desktop.
Save pansila/15f5cac6b98000b578a735dad87cf2fb to your computer and use it in GitHub Desktop.
diff --git a/cpplint.py b/cpplint.py
index b8cabad..769a61a 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -3564,7 +3564,7 @@ def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
line = clean_lines.elided[linenum]
# No spaces after an if, while, switch, or for
- match = Search(r' (if\(|for\(|while\(|switch\()', line)
+ match = Search(r'\b(if\(|for\(|while\(|switch\()', line)
if match:
error(filename, linenum, 'whitespace/parens', 5,
'Missing space before ( in %s' % match.group(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment