mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Use traverse instead of sequence and map
This commit is contained in:
parent
3bd7df955b
commit
dedf932fe8
1 changed files with 1 additions and 1 deletions
|
@ -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."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue