Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 20005:22154ec6fb8b stable
check-code: prepend warning prefix only once, but for each warning
The code adding the prefix is now run once per pattern. It was run once per
file (after the change 3e1e4a8aec1e).
Demonstrate that it is working now by extending the test. Raise two different
warnings, one of them twice.
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Sat, 09 Nov 2013 10:21:20 +0100 |
parents | 169cb9e47f8e |
children | a1d88278beff |
line wrap: on
line diff
--- a/contrib/check-code.py Wed Nov 13 16:46:46 2013 -0200 +++ b/contrib/check-code.py Sat Nov 09 10:21:20 2013 +0100 @@ -467,6 +467,8 @@ else: p, msg = pat ignore = None + if i >= nerrs: + msg = "warning: " + msg pos = 0 n = 0 @@ -500,8 +502,7 @@ 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