Mercurial > hg
changeset 27989:e77ac31b64a1
check-code: allow "grep pattern filename-containing-dash-a"
We're trying to forbid "grep -a" and unintentionally complained even
if the "-a" was part of the filename. Requiring a space before "-a" to
match is probably good enough.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 02 Feb 2016 21:20:04 -0800 |
parents | 79139c7a88bd |
children | 96bfd2875213 |
files | contrib/check-code.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py Fri Feb 05 15:18:40 2016 +0100 +++ b/contrib/check-code.py Tue Feb 02 21:20:04 2016 -0800 @@ -90,7 +90,7 @@ (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), - (r'(?<!hg )grep.*-a', "don't use 'grep -a', use in-line python"), + (r'(?<!hg )grep.* -a', "don't use 'grep -a', use in-line python"), (r'sed.*-i', "don't use 'sed -i', use a temporary file"), (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"), (r'echo -n', "don't use 'echo -n', use printf"),