Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 19081:e97ce4a5afc5 stable
check-code: expand sed rule to include more offenders
Expands the rule added in 5e4491c114b2 to include cases where the
address is a line number instead of a regular expression, and fixes an
instance of this pattern in test-unionrepo.t.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Mon, 22 Apr 2013 16:50:08 -0500 |
parents | 5e4491c114b2 |
children | 12f15e4b2ca0 |
line wrap: on
line diff
--- a/contrib/check-code.py Mon Apr 22 16:33:28 2013 -0500 +++ b/contrib/check-code.py Mon Apr 22 16:50:08 2013 -0500 @@ -74,7 +74,7 @@ (r'/dev/u?random', "don't use entropy, use /dev/zero"), (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"), (r'^( *)\t', "don't use tabs to indent"), - (r'sed .*\'/[^/]*/i[^\\][^\n]', + (r'sed .*\'(\d+|/[^/]*/)i[^\\][^\n]', "put a backslash-escaped newline after sed 'i' command"), ], # warnings