Skip to content
Snippets Groups Projects
Commit e97ce4a5 authored by Kevin Bullock's avatar Kevin Bullock
Browse files

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.
parent 5e4491c1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -25,7 +25,8 @@
$ hg clone -q repo1 --rev 0 repo2
$ cd repo2
$ touch repo2-1
$ sed '1irepo2-1 at top' f > f.tmp
$ sed '1i\
> repo2-1 at top' f > f.tmp
$ mv f.tmp f
$ hg ci -Aqmrepo2-1
$ touch repo2-2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment