Incorporate hlint suggestions

This commit is contained in:
Joshua Clayton 2016-06-01 05:36:32 -04:00
parent 95836e536b
commit 0dcb06fe70
4 changed files with 7 additions and 7 deletions

View File

@ -20,7 +20,7 @@ searchResults terms =
runReaderT (printFormattedTerms terms) columnFormat
where
columnFormat = buildColumnFormatter $ termsToResults terms
termsToResults = concatMap Map.elems . map snd
termsToResults = concatMap (Map.elems . snd)
printFormattedTerms :: [GroupedTerms] -> ResultsPrinter ()
printFormattedTerms [] = liftIO V.noResultsFound

View File

@ -60,8 +60,8 @@ matcherToBool (AppOccurrences i) = (== i) . appOccurrenceCount
matcherToBool (AllowedTerms ts) = flip isAllowedTerm ts
positionToRegex :: Position -> (String -> String -> Bool)
positionToRegex StartsWith = \v -> isPrefixOf v
positionToRegex EndsWith = \v -> isSuffixOf v
positionToRegex StartsWith = isPrefixOf
positionToRegex EndsWith = isSuffixOf
positionToRegex Equals = (==)
paths :: TermResults -> [String]

View File

@ -78,7 +78,7 @@ stringListHandler = MatchHandler
, mhKeyToMatcher = keyToMatcher
}
where
keyToMatcher "allowedTerms" = Right $ AllowedTerms
keyToMatcher "allowedTerms" = Right AllowedTerms
keyToMatcher t = Left t
parseMatchers :: Y.Object -> Y.Parser [Matcher]

View File

@ -13,9 +13,9 @@ import Unused.Util (stringToInt)
commandLineOptions :: String -> [String]
commandLineOptions t =
case regexSafeTerm t of
True -> ["(\\W|^)" ++ t ++ "(\\W|$)", "."] ++ baseFlags
False -> [t, ".", "-Q"] ++ baseFlags
if regexSafeTerm t
then ["(\\W|^)" ++ t ++ "(\\W|$)", "."] ++ baseFlags
else [t, ".", "-Q"] ++ baseFlags
where
baseFlags = ["-c", "--ackmate", "--ignore-dir", "tmp/unused"]