mirror of
https://github.com/facebook/sapling.git
synced 2025-01-07 14:10:42 +03:00
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
This commit is contained in:
parent
e92757d9ec
commit
e4fdb2e534
@ -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'(?<!!)/bin/', "don't use explicit paths for tools"),
|
||||
(r'#!.*/bash', "don't use bash in shebang, use sh"),
|
||||
(r'[^\n]\Z', "no trailing newline"),
|
||||
(r'export .*=', "don't export and assign at once"),
|
||||
(r'^source\b', "don't use 'source', use '.'"),
|
||||
@ -159,7 +160,7 @@ testpats = [
|
||||
]
|
||||
|
||||
testfilters = [
|
||||
(r"( *)(#([^\n]*\S)?)", repcomment),
|
||||
(r"( *)(#([^!][^\n]*\S)?)", repcomment),
|
||||
(r"<<(\S+)((.|\n)*?\n\1)", rephere),
|
||||
]
|
||||
|
||||
@ -232,7 +233,7 @@ for i in [0, 1]:
|
||||
|
||||
utestfilters = [
|
||||
(r"<<(\S+)((.|\n)*?\n > \1)", rephere),
|
||||
(r"( +)(#([^\n]*\S)?)", repcomment),
|
||||
(r"( +)(#([^!][^\n]*\S)?)", repcomment),
|
||||
]
|
||||
|
||||
pypats = [
|
||||
|
Loading…
Reference in New Issue
Block a user