mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-10 15:22:58 -07:00
Add bats support
This is motivated by the fact that the popularity of bats is increasing since the creation of bats-core/bats-core. The code is a cherry-pick of koalaman/shellcheck/bats branch. Fix koalaman/shellcheck#417.
This commit is contained in:
parent
c6c615217b
commit
f187382a0c
5 changed files with 37 additions and 1 deletions
|
@ -2331,6 +2331,17 @@ readBraceGroup = called "brace group" $ do
|
|||
id <- endSpan start
|
||||
return $ T_BraceGroup id list
|
||||
|
||||
prop_readBatsTest = isOk readBatsTest "@test 'can parse' {\n true\n}"
|
||||
readBatsTest = called "bats @test" $ do
|
||||
start <- startSpan
|
||||
try $ string "@test"
|
||||
spacing
|
||||
name <- readNormalWord
|
||||
spacing
|
||||
test <- readBraceGroup
|
||||
id <- endSpan start
|
||||
return $ T_BatsTest id name test
|
||||
|
||||
prop_readWhileClause = isOk readWhileClause "while [[ -e foo ]]; do sleep 1; done"
|
||||
readWhileClause = called "while loop" $ do
|
||||
start <- startSpan
|
||||
|
@ -2590,6 +2601,7 @@ readCompoundCommand = do
|
|||
readForClause,
|
||||
readSelectClause,
|
||||
readCaseClause,
|
||||
readBatsTest,
|
||||
readFunctionDefinition
|
||||
]
|
||||
spacing
|
||||
|
@ -3037,6 +3049,7 @@ readScriptFile = do
|
|||
"ash",
|
||||
"dash",
|
||||
"bash",
|
||||
"bats",
|
||||
"ksh"
|
||||
]
|
||||
badShells = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue