##// END OF EJS Templates
style: ban [ foo == bar] bashism in tests
Augie Fackler -
r32293:ca727147 default
parent child Browse files
Show More
@@ -116,6 +116,7 b' testpats = ['
116 116 (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
117 117 (r'\$\(.*\)', "don't use $(expr), use `expr`"),
118 118 (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
119 (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'),
119 120 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
120 121 "use egrep for extended grep syntax"),
121 122 (r'/bin/', "don't use explicit paths for tools"),
@@ -152,6 +152,15 b''
152 152 > $ function onwarn {}
153 153 warning: don't use 'function', use old style
154 154 [1]
155 $ cat > error.t <<EOF
156 > $ [ foo == bar ]
157 > EOF
158 $ "$check_code" error.t
159 error.t:1:
160 > $ [ foo == bar ]
161 [ foo == bar ] is a bashism, use [ foo = bar ] instead
162 [1]
163 $ rm error.t
155 164 $ cat > raise-format.py <<EOF
156 165 > raise SomeException, message
157 166 > # this next line is okay
General Comments 0
You need to be logged in to leave comments. Login now