##// END OF EJS Templates
check-code: prepend warning prefix only once, but for each warning...
Simon Heimberg -
r20005:22154ec6 stable
parent child Browse files
Show More
@@ -467,6 +467,8 b' def checkfile(f, logfunc=_defaultlogger.'
467 467 else:
468 468 p, msg = pat
469 469 ignore = None
470 if i >= nerrs:
471 msg = "warning: " + msg
470 472
471 473 pos = 0
472 474 n = 0
@@ -500,8 +502,7 b' def checkfile(f, logfunc=_defaultlogger.'
500 502 bl, bu, br = blamecache[n]
501 503 if bl == l:
502 504 bd = '%s@%s' % (bu, br)
503 if i >= nerrs:
504 msg = "warning: " + msg
505
505 506 errors.append((f, lineno and n + 1, l, msg, bd))
506 507 result = False
507 508
@@ -185,12 +185,20 b''
185 185 $ cat > warning.t <<EOF
186 186 > $ function warnonly {
187 187 > > }
188 > $ diff -N aaa
189 > $ function onwarn {}
188 190 > EOF
189 191 $ "$check_code" warning.t
190 192 $ "$check_code" --warn warning.t
191 193 warning.t:1:
192 194 > $ function warnonly {
193 195 warning: don't use 'function', use old style
196 warning.t:3:
197 > $ diff -N aaa
198 warning: don't use 'diff -N'
199 warning.t:4:
200 > $ function onwarn {}
201 warning: don't use 'function', use old style
194 202 [1]
195 203 $ cat > raise-format.py <<EOF
196 204 > raise SomeException, message
General Comments 0
You need to be logged in to leave comments. Login now