mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 09:38:48 +08:00
Fuse map into any
This commit is contained in:
@@ -2481,7 +2481,7 @@ checkCharRangeGlob p t@(T_Glob id str) |
|
|||||||
where
|
where
|
||||||
isCharClass str = "[" `isPrefixOf` str && "]" `isSuffixOf` str
|
isCharClass str = "[" `isPrefixOf` str && "]" `isSuffixOf` str
|
||||||
contents = dropNegation . drop 1 . take (length str - 1) $ str
|
contents = dropNegation . drop 1 . take (length str - 1) $ str
|
||||||
hasDupes = any (>1) . map length . group . sort . filter (/= '-') $ contents
|
hasDupes = any ((>1) . length) . group . sort . filter (/= '-') $ contents
|
||||||
dropNegation s =
|
dropNegation s =
|
||||||
case s of
|
case s of
|
||||||
'!':rest -> rest
|
'!':rest -> rest
|
||||||
@@ -3404,7 +3404,7 @@ checkPipeToNowhere params t =
|
|||||||
|
|
||||||
commandSpecificException name cmd =
|
commandSpecificException name cmd =
|
||||||
case name of
|
case name of
|
||||||
"du" -> any (`elem` ["exclude-from", "files0-from"]) $ map snd $ getAllFlags cmd
|
"du" -> any ((`elem` ["exclude-from", "files0-from"]) . snd) $ getAllFlags cmd
|
||||||
_ -> False
|
_ -> False
|
||||||
|
|
||||||
warnAboutDupes (n, list@(_:_:_)) =
|
warnAboutDupes (n, list@(_:_:_)) =
|
||||||
|
Reference in New Issue
Block a user