mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 13:31:36 -07:00
Use find instead of listToMaybe and filter
This commit is contained in:
parent
0f48bb78a5
commit
f5c6771016
3 changed files with 7 additions and 7 deletions
|
@ -340,8 +340,8 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
|||
potentially $ do
|
||||
allowed' <- Map.lookup name allowedFlags
|
||||
allowed <- allowed'
|
||||
(word, flag) <- listToMaybe $
|
||||
filter (\x -> (not . null . snd $ x) && snd x `notElem` allowed) flags
|
||||
(word, flag) <- find
|
||||
(\x -> (not . null . snd $ x) && snd x `notElem` allowed) flags
|
||||
return . warnMsg (getId word) $ name ++ " -" ++ flag ++ " is"
|
||||
|
||||
when (name == "source") $ warnMsg id "'source' in place of '.' is"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue