mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 13:01:39 -07:00
Merge pull request #988 from Nightfirecat/953-local-A-fix
SC2154: Fix false positive on `local`
This commit is contained in:
commit
ccc037d458
1 changed files with 2 additions and 1 deletions
|
@ -329,7 +329,8 @@ getAssociativeArrays t =
|
|||
f :: Token -> Writer [String] ()
|
||||
f t@T_SimpleCommand {} = fromMaybe (return ()) $ do
|
||||
name <- getCommandName t
|
||||
guard $ name == "declare" || name == "typeset"
|
||||
let assocNames = ["declare","local","typeset"]
|
||||
guard $ elem name assocNames
|
||||
let flags = getAllFlags t
|
||||
guard $ elem "A" $ map snd flags
|
||||
let args = map fst . filter ((==) "" . snd) $ flags
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue