checkcode: only match pushd/popd as word
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 10 Apr 2017 17:05:54 +0200
changeset 31877 14c5a7637ecc
parent 31876 94c1d3c1aea2
child 31878 4d0465dd13d2
checkcode: only match pushd/popd as word otherwise it partially match common words like "pushdestination".
contrib/check-code.py
--- a/contrib/check-code.py	Mon Apr 10 13:07:47 2017 -0700
+++ b/contrib/check-code.py	Mon Apr 10 17:05:54 2017 +0200
@@ -100,7 +100,7 @@
 
 testpats = [
   [
-    (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"),
+    (r'\b(push|pop)d\b', "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"),