summaryrefslogtreecommitdiff
path: root/.arc-linters
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-10-20 16:13:46 -0400
committerBen Gamari <ben@smart-cactus.org>2016-10-20 16:17:24 -0400
commitc23dc6164d54eacc654516b885104dc8b7678f16 (patch)
tree1d4a4c83fc26d00dd92bc38958c29660992b5c4b /.arc-linters
parentc2142ca6707ca0b8b1ea96b8cfa954b20eab717c (diff)
downloadhaskell-c23dc6164d54eacc654516b885104dc8b7678f16.tar.gz
check-cpp: Make it more robust
Catch more than one space
Diffstat (limited to '.arc-linters')
-rwxr-xr-x.arc-linters/check-cpp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/.arc-linters/check-cpp.py b/.arc-linters/check-cpp.py
index 2f32f9be6a..52961e6edd 100755
--- a/.arc-linters/check-cpp.py
+++ b/.arc-linters/check-cpp.py
@@ -6,6 +6,7 @@
import sys
import logging
import os
+import re
import json
def setup_logging(logger):
@@ -24,10 +25,11 @@ logger.debug(sys.argv)
path = sys.argv[1]
warnings = []
+r = re.compile(r'ASSERT\s+\(')
if os.path.isfile(path):
with open(path) as f:
for lineno, line in enumerate(f):
- if 'ASSERT (' in line:
+ if r.search(line):
warning = {
'severity': 'warning',
'message': 'CPP macros should not have a space between the macro name and their argument list',