check-code: ban use of '[[ ]]' in tests
authorYuya Nishihara <yuya@tcha.org>
Tue, 16 Jun 2015 23:06:30 +0900
changeset 25588 b40071379c5b
parent 25587 49fb24f72747
child 25589 273d94255e1e
check-code: ban use of '[[ ]]' in tests
contrib/check-code.py
--- a/contrib/check-code.py	Tue Jun 16 22:47:05 2015 +0900
+++ b/contrib/check-code.py	Tue Jun 16 23:06:30 2015 +0900
@@ -114,6 +114,7 @@
     (r'[^>\n]>\s*\$HGRCPATH', "don't overwrite $HGRCPATH, append to it"),
     (r'^stop\(\)', "don't use 'stop' as a shell function name"),
     (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),
+    (r'\[\[\s+[^\]]*\]\]', "don't use '[[ ]]', use '[ ]'"),
     (r'^alias\b.*=', "don't use alias, use a function"),
     (r'if\s*!', "don't use '!' to negate exit status"),
     (r'/dev/u?random', "don't use entropy, use /dev/zero"),