[commit: ghc] master: check-cpp: Make it more robust (c23dc61)

git at git.haskell.org git at git.haskell.org
Thu Oct 20 20:17:44 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c23dc6164d54eacc654516b885104dc8b7678f16/ghc

>---------------------------------------------------------------

commit c23dc6164d54eacc654516b885104dc8b7678f16
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Oct 20 16:13:46 2016 -0400

    check-cpp: Make it more robust
    
    Catch more than one space


>---------------------------------------------------------------

c23dc6164d54eacc654516b885104dc8b7678f16
 .arc-linters/check-cpp.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.arc-linters/check-cpp.py b/.arc-linters/check-cpp.py
index 2f32f9b..52961e6 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',



More information about the ghc-commits mailing list