changeset 25588:b40071379c5b

check-code: ban use of '[[ ]]' in tests
author Yuya Nishihara <yuya@tcha.org>
date Tue, 16 Jun 2015 23:06:30 +0900
parents 49fb24f72747
children 273d94255e1e
files contrib/check-code.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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"),