##// END OF EJS Templates
check-code: document reason and suggest alternative to exit code negation...
marmoute -
r52853:1c23faf6 stable
parent child Browse files
Show More
@@ -161,7 +161,11 testpats = [
161 (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),
161 (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),
162 (r'\[\[\s+[^\]]*\]\]', "don't use '[[ ]]', use '[ ]'"),
162 (r'\[\[\s+[^\]]*\]\]', "don't use '[[ ]]', use '[ ]'"),
163 (r'^alias\b.*=', "don't use alias, use a function"),
163 (r'^alias\b.*=', "don't use alias, use a function"),
164 (r'if\s*!', "don't use '!' to negate exit status"),
164 # Solaris sh can not negate exit status with '!'
165 (
166 r'if\s*!',
167 "don't use '!' to negate exit status (use `||` or if/else)",
168 ),
165 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
169 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
166 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
170 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
167 (
171 (
General Comments 0
You need to be logged in to leave comments. Login now