[PATCH 2 of 2] check-code: ban use of '[[ ]]' in tests
Yuya Nishihara
yuya at tcha.org
Tue Jun 16 10:11:57 CDT 2015
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1434463590 -32400
# Tue Jun 16 23:06:30 2015 +0900
# Node ID e321716cab1d0cec13a6cc3613d8201b4f34f7d9
# Parent 058a621cadbfcfbd53fb40d0b6b65074b8919b37
check-code: ban use of '[[ ]]' in tests
diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -114,6 +114,7 @@ testpats = [
(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"),
More information about the Mercurial-devel
mailing list