Use find instead of listToMaybe and filter

This commit is contained in:
Joseph C. Sible 2020-02-01 22:50:16 -05:00
parent 0f48bb78a5
commit f5c6771016
3 changed files with 7 additions and 7 deletions

View file

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