Merge pull request #988 from Nightfirecat/953-local-A-fix

SC2154: Fix false positive on `local`
This commit is contained in:
koalaman 2017-09-09 09:37:04 -07:00 committed by GitHub
commit ccc037d458
1 changed files with 2 additions and 1 deletions

View File

@ -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