cln: hlint: Remove warnings to use library list functions.

This commit is contained in:
Stephen Morgan 2021-08-16 15:15:45 +10:00 committed by Simon Michael
parent 330c21659f
commit 22db5c4a3f
4 changed files with 6 additions and 15 deletions

View File

@ -17,7 +17,6 @@
- ignore: {name: "Eta reduce"}
- ignore: {name: "Use $>"}
- ignore: {name: "Use unless"}
- ignore: {name: "Use any"}
- ignore: {name: "Use =<<"}
- ignore: {name: "Use fmap"}
- ignore: {name: "Use <&>"}
@ -27,14 +26,12 @@
- ignore: {name: "Redundant <$>"}
- ignore: {name: "Use list literal pattern"}
- ignore: {name: "Use fewer imports"}
- ignore: {name: "Use intercalate"}
- ignore: {name: "Use tuple-section"}
- ignore: {name: "Use section"}
- ignore: {name: "Avoid lambda using `infix`"}
- ignore: {name: "Functor law"}
- ignore: {name: "Missing NOINLINE pragma"}
- ignore: {name: "Use dropWhile"}
- ignore: {name: "Use &&"}
- ignore: {name: "Use replicate"}
- ignore: {name: "Use void"}
- ignore: {name: "Use elemIndex"}

View File

@ -216,11 +216,7 @@ ensureJournalFileExists f = do
-- | Does any part of this path contain non-. characters and end with a . ?
-- Such paths are not safe to use on Windows (cf #1056).
isWindowsUnsafeDotPath :: FilePath -> Bool
isWindowsUnsafeDotPath =
not . null .
filter (not . all (=='.')) .
filter ((=='.').last) .
splitDirectories
isWindowsUnsafeDotPath = any (\x -> last x == '.' && any (/='.') x) . splitDirectories
-- | Give the content for a new auto-created journal file.
newJournalContent :: IO Text

View File

@ -200,11 +200,9 @@ useColorOnHandle h = unsafePerformIO $ do
no_color <- isJust <$> lookupEnv "NO_COLOR"
supports_color <- hSupportsANSIColor h
let coloroption = colorOption
return $ and [
not no_color
,coloroption `notElem` ["never","no"]
,coloroption `elem` ["always","yes"] || supports_color
]
return $ not no_color
&& coloroption `notElem` ["never","no"]
&& (coloroption `elem` ["always","yes"] || supports_color)
-- Keep synced with color/colour flag definition in hledger:CliOptions.
-- Avoid using dbg*, pshow etc. in this function (infinite loop).

View File

@ -27,7 +27,7 @@ module Text.Tabular.AsciiWide
import Data.Bifunctor (bimap)
import Data.Maybe (fromMaybe)
import Data.Default (Default(..))
import Data.List (intersperse, transpose)
import Data.List (intercalate, intersperse, transpose)
import Data.Semigroup (stimesMonoid)
import Data.Text (Text)
import qualified Data.Text as T
@ -128,7 +128,7 @@ renderTableByRowsB topts@TableOpts{prettyTable=pretty, tableBorders=borders} fc
-- maximum width for each column
sizes = map (fromMaybe 0 . maximumMay . map cellWidth) $ transpose cells2
renderRs (Header s) = [s]
renderRs (Group p hs) = concat . intersperse sep $ map renderRs hs
renderRs (Group p hs) = intercalate sep $ map renderRs hs
where sep = renderHLine VM borders pretty sizes ch2 p
-- borders and bars