##// 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 (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
116 (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
117 (r'\$\(.*\)', "don't use $(expr), use `expr`"),
117 (r'\$\(.*\)', "don't use $(expr), use `expr`"),
118 (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
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 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
120 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
120 "use egrep for extended grep syntax"),
121 "use egrep for extended grep syntax"),
121 (r'/bin/', "don't use explicit paths for tools"),
122 (r'/bin/', "don't use explicit paths for tools"),
@@ -152,6 +152,15 b''
152 > $ function onwarn {}
152 > $ function onwarn {}
153 warning: don't use 'function', use old style
153 warning: don't use 'function', use old style
154 [1]
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 $ cat > raise-format.py <<EOF
164 $ cat > raise-format.py <<EOF
156 > raise SomeException, message
165 > raise SomeException, message
157 > # this next line is okay
166 > # this next line is okay
General Comments 0
You need to be logged in to leave comments. Login now