diff --git a/src/Unused/CLI/Views/SearchResult.hs b/src/Unused/CLI/Views/SearchResult.hs index 4d0aa0b..f85ac7d 100644 --- a/src/Unused/CLI/Views/SearchResult.hs +++ b/src/Unused/CLI/Views/SearchResult.hs @@ -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 diff --git a/src/Unused/ResponseFilter.hs b/src/Unused/ResponseFilter.hs index 99b2f6d..d504a40 100644 --- a/src/Unused/ResponseFilter.hs +++ b/src/Unused/ResponseFilter.hs @@ -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] diff --git a/src/Unused/ResultsClassifier/Types.hs b/src/Unused/ResultsClassifier/Types.hs index c0e939b..17d759a 100644 --- a/src/Unused/ResultsClassifier/Types.hs +++ b/src/Unused/ResultsClassifier/Types.hs @@ -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] diff --git a/src/Unused/TermSearch/Internal.hs b/src/Unused/TermSearch/Internal.hs index 1831231..9b67f60 100644 --- a/src/Unused/TermSearch/Internal.hs +++ b/src/Unused/TermSearch/Internal.hs @@ -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"]