contrib/check-code.py
changeset 19422 d9e86d656017
parent 19382 5aeb03b48ab4
child 19494 3119dc155ac2
--- a/contrib/check-code.py	Wed Jul 17 10:49:34 2013 +0200
+++ b/contrib/check-code.py	Tue Jul 16 01:29:14 2013 +0200
@@ -137,7 +137,7 @@
   # warnings
   [
     (r'^  [^*?/\n]* \(glob\)$',
-     "warning: glob match with no glob character (?*/)"),
+     "glob match with no glob character (?*/)"),
   ]
 ]
 
@@ -417,6 +417,7 @@
             break
         for p, r in filters:
             post = re.sub(p, r, post)
+        nerrs = len(pats[0]) # nerr elements are errors
         if warnings:
             pats = pats[0] + pats[1]
         else:
@@ -428,7 +429,7 @@
 
         prelines = None
         errors = []
-        for pat in pats:
+        for i, pat in enumerate(pats):
             if len(pat) == 3:
                 p, msg, ignore = pat
             else:
@@ -467,6 +468,8 @@
                         bl, bu, br = blamecache[n]
                         if bl == l:
                             bd = '%s@%s' % (bu, br)
+                if i >= nerrs:
+                    msg = "warning: " + msg
                 errors.append((f, lineno and n + 1, l, msg, bd))
                 result = False