mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-18 09:47:08 +08:00
Simplify findFunction
This commit is contained in:
@@ -2488,12 +2488,10 @@ checkUnpassedInFunctions params root =
|
|||||||
map (\t@(T_Function _ _ _ name _) -> (name,t)) functions
|
map (\t@(T_Function _ _ _ name _) -> (name,t)) functions
|
||||||
functions = execWriter $ doAnalysis (tell . maybeToList . findFunction) root
|
functions = execWriter $ doAnalysis (tell . maybeToList . findFunction) root
|
||||||
|
|
||||||
findFunction t@(T_Function id _ _ name body) =
|
findFunction t@(T_Function id _ _ name body)
|
||||||
let flow = getVariableFlow params body
|
| any (isPositionalReference t) flow && not (any isPositionalAssignment flow)
|
||||||
in
|
= return t
|
||||||
if any (isPositionalReference t) flow && not (any isPositionalAssignment flow)
|
where flow = getVariableFlow params body
|
||||||
then return t
|
|
||||||
else Nothing
|
|
||||||
findFunction _ = Nothing
|
findFunction _ = Nothing
|
||||||
|
|
||||||
isPositionalAssignment x =
|
isPositionalAssignment x =
|
||||||
|
Reference in New Issue
Block a user