Skip to content

Commit

Permalink
Fixed case sensitivity in 'trap' bashism test
Browse files Browse the repository at this point in the history
  • Loading branch information
koalaman committed Apr 5, 2015
1 parent cc86aab commit 081751c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ShellCheck/Analytics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ prop_checkBashisms22= verifyNot checkBashisms "[ foo -a bar ]"
prop_checkBashisms23= verify checkBashisms "trap mything err int"
prop_checkBashisms24= verifyNot checkBashisms "trap mything int term"
prop_checkBashisms25= verify checkBashisms "cat < /dev/tcp/host/123"
prop_checkBashisms26= verify checkBashisms "trap mything ERR SIGTERM"
checkBashisms _ = bashism
where
errMsg id s = err id 2040 $ "In sh, " ++ s ++ " not supported, even when sh is actually bash."
Expand Down Expand Up @@ -718,7 +719,7 @@ checkBashisms _ = bashism
when (name == "trap") $
let
check token = potentially $ do
word <- getLiteralString token
word <- liftM (map toLower) $ getLiteralString token
guard $ word `elem` ["err", "debug", "return"]
return $ warnMsg (getId token) $ "trapping " ++ word ++ " is"
in
Expand Down

0 comments on commit 081751c

Please sign in to comment.