# HG changeset patch # User Jun Wu # Date 2017-09-01 22:47:32 # Node ID e267d4ee4f2d0d6bf961828ceec5748c385c8ce1 # Parent 6fb5a06b92c62d4ac8c3e6468ddadc8c46c4da1e check-code: forbid using bash in shebang Some platforms (ex. FreeBSD) do not have `bash` by default. Therefore it should not be used in test scripts. Differential Revision: https://phab.mercurial-scm.org/D609 diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -119,7 +119,8 @@ testpats = [ (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"), + (r'(? \1)", rephere), - (r"( +)(#([^\n]*\S)?)", repcomment), + (r"( +)(#([^!][^\n]*\S)?)", repcomment), ] pypats = [