Mercurial > hg
comparison contrib/check-code.py @ 31877:14c5a7637ecc
checkcode: only match pushd/popd as word
otherwise it partially match common words like "pushdestination".
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Mon, 10 Apr 2017 17:05:54 +0200 |
parents | 4804644489cf |
children | ac641a41f98d |
comparison
equal
deleted
inserted
replaced
31876:94c1d3c1aea2 | 31877:14c5a7637ecc |
---|---|
98 return m.group(1) + t | 98 return m.group(1) + t |
99 | 99 |
100 | 100 |
101 testpats = [ | 101 testpats = [ |
102 [ | 102 [ |
103 (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"), | 103 (r'\b(push|pop)d\b', "don't use 'pushd' or 'popd', use 'cd'"), |
104 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), | 104 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"), |
105 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), | 105 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"), |
106 (r'(?<!hg )grep.* -a', "don't use 'grep -a', use in-line python"), | 106 (r'(?<!hg )grep.* -a', "don't use 'grep -a', use in-line python"), |
107 (r'sed.*-i', "don't use 'sed -i', use a temporary file"), | 107 (r'sed.*-i', "don't use 'sed -i', use a temporary file"), |
108 (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"), | 108 (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"), |