diff contrib/check-code.py @ 32293:ca727147ff9f

style: ban [ foo == bar] bashism in tests
author Augie Fackler <augie@google.com>
date Mon, 15 May 2017 14:08:02 -0400
parents cf424dae5dc7
children 1651977596c0
line wrap: on
line diff
--- a/contrib/check-code.py	Sat May 13 16:26:43 2017 -0700
+++ b/contrib/check-code.py	Mon May 15 14:08:02 2017 -0400
@@ -116,6 +116,7 @@
     (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"),
     (r'\$\(.*\)', "don't use $(expr), use `expr`"),
     (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
+    (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'),
     (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
      "use egrep for extended grep syntax"),
     (r'/bin/', "don't use explicit paths for tools"),