##// 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 else:
467 else:
468 p, msg = pat
468 p, msg = pat
469 ignore = None
469 ignore = None
470 if i >= nerrs:
471 msg = "warning: " + msg
470
472
471 pos = 0
473 pos = 0
472 n = 0
474 n = 0
@@ -500,8 +502,7 b' def checkfile(f, logfunc=_defaultlogger.'
500 bl, bu, br = blamecache[n]
502 bl, bu, br = blamecache[n]
501 if bl == l:
503 if bl == l:
502 bd = '%s@%s' % (bu, br)
504 bd = '%s@%s' % (bu, br)
503 if i >= nerrs:
505
504 msg = "warning: " + msg
505 errors.append((f, lineno and n + 1, l, msg, bd))
506 errors.append((f, lineno and n + 1, l, msg, bd))
506 result = False
507 result = False
507
508
@@ -185,12 +185,20 b''
185 $ cat > warning.t <<EOF
185 $ cat > warning.t <<EOF
186 > $ function warnonly {
186 > $ function warnonly {
187 > > }
187 > > }
188 > $ diff -N aaa
189 > $ function onwarn {}
188 > EOF
190 > EOF
189 $ "$check_code" warning.t
191 $ "$check_code" warning.t
190 $ "$check_code" --warn warning.t
192 $ "$check_code" --warn warning.t
191 warning.t:1:
193 warning.t:1:
192 > $ function warnonly {
194 > $ function warnonly {
193 warning: don't use 'function', use old style
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 [1]
202 [1]
195 $ cat > raise-format.py <<EOF
203 $ cat > raise-format.py <<EOF
196 > raise SomeException, message
204 > raise SomeException, message
General Comments 0
You need to be logged in to leave comments. Login now