mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 22:35:54 +08:00
Use traverse instead of sequence and map
This commit is contained in:
@@ -4936,7 +4936,7 @@ checkOverwrittenExitCode params t =
|
|||||||
guard . not $ S.null exitCodeIds
|
guard . not $ S.null exitCodeIds
|
||||||
|
|
||||||
let idToToken = idMap params
|
let idToToken = idMap params
|
||||||
exitCodeTokens <- sequence $ map (\k -> Map.lookup k idToToken) $ S.toList exitCodeIds
|
exitCodeTokens <- traverse (\k -> Map.lookup k idToToken) $ S.toList exitCodeIds
|
||||||
return $ do
|
return $ do
|
||||||
when (all isCondition exitCodeTokens && not (usedUnconditionally t exitCodeIds)) $
|
when (all isCondition exitCodeTokens && not (usedUnconditionally t exitCodeIds)) $
|
||||||
warn id 2319 "This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten."
|
warn id 2319 "This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten."
|
||||||
|
Reference in New Issue
Block a user