Include shebang in AST traversal (fixes #1858)
This commit is contained in:
parent
acee69676b
commit
7963eeab9d
|
@ -249,7 +249,11 @@ analyze f g i =
|
||||||
list <- mapM round group
|
list <- mapM round group
|
||||||
return $ T_ForArithmetic id x y z list
|
return $ T_ForArithmetic id x y z list
|
||||||
|
|
||||||
delve (T_Script id s l) = dl l $ T_Script id s
|
delve (T_Script id shebang list) = do
|
||||||
|
newShebang <- round shebang
|
||||||
|
newList <- roundAll list
|
||||||
|
return $ T_Script id newShebang newList
|
||||||
|
|
||||||
delve (T_Function id a b name body) = d1 body $ T_Function id a b name
|
delve (T_Function id a b name body) = d1 body $ T_Function id a b name
|
||||||
delve (T_Condition id typ token) = d1 token $ T_Condition id typ
|
delve (T_Condition id typ token) = d1 token $ T_Condition id typ
|
||||||
delve (T_Extglob id str l) = dl l $ T_Extglob id str
|
delve (T_Extglob id str l) = dl l $ T_Extglob id str
|
||||||
|
|
|
@ -288,6 +288,13 @@ prop_deducesTypeFromExtension2 = result == [2079]
|
||||||
csScript = "(( 3.14 ))"
|
csScript = "(( 3.14 ))"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prop_canDisableShebangWarning = null $ result
|
||||||
|
where
|
||||||
|
result = checkWithSpec [] emptyCheckSpec {
|
||||||
|
csFilename = "file.sh",
|
||||||
|
csScript = "#shellcheck disable=SC2148\nfoo"
|
||||||
|
}
|
||||||
|
|
||||||
prop_shExtensionDoesntMatter = result == [2148]
|
prop_shExtensionDoesntMatter = result == [2148]
|
||||||
where
|
where
|
||||||
result = checkWithSpec [] emptyCheckSpec {
|
result = checkWithSpec [] emptyCheckSpec {
|
||||||
|
|
Loading…
Reference in New Issue