mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
cln: hlint: Remove redundant where and lambda warnings.
This commit is contained in:
parent
71032c637e
commit
eb6047e81b
@ -40,7 +40,6 @@
|
||||
- ignore: {name: "Use section"}
|
||||
- ignore: {name: "Use maybe"}
|
||||
- ignore: {name: "Fuse concatMap/map"}
|
||||
- ignore: {name: "Redundant where"}
|
||||
- ignore: {name: "Use concatMap"}
|
||||
- ignore: {name: "Redundant bang pattern"}
|
||||
- ignore: {name: "Use zipWith"}
|
||||
@ -57,7 +56,6 @@
|
||||
- ignore: {name: "Use elemIndex"}
|
||||
- ignore: {name: "Use =="}
|
||||
- ignore: {name: "Use lambda-case"}
|
||||
- ignore: {name: "Redundant lambda"}
|
||||
- ignore: {name: "Replace case with fromMaybe"}
|
||||
|
||||
|
||||
|
@ -272,7 +272,7 @@ outputFileOption =
|
||||
-- uses unsafePerformIO.
|
||||
traceAt :: Int -> String -> a -> a
|
||||
traceAt level
|
||||
| level > 0 && debugLevel < level = flip const
|
||||
| level > 0 && debugLevel < level = const id
|
||||
| otherwise = trace
|
||||
|
||||
-- | Trace (print to stderr) a showable value using a custom show function,
|
||||
@ -286,7 +286,7 @@ traceAtWith level f a = traceAt level (f a) a
|
||||
-- At level 0, always prints. Otherwise, uses unsafePerformIO.
|
||||
ptraceAt :: Show a => Int -> String -> a -> a
|
||||
ptraceAt level
|
||||
| level > 0 && debugLevel < level = flip const
|
||||
| level > 0 && debugLevel < level = const id
|
||||
| otherwise = \s a -> let p = pshow a
|
||||
ls = lines p
|
||||
nlorspace | length ls > 1 = "\n"
|
||||
|
@ -283,8 +283,7 @@ topBottomBorderWithLabels toplabel bottomlabel body =
|
||||
-- XXX May disrupt border style of inner widgets.
|
||||
-- XXX Should reduce the available size visible to inner widget, but doesn't seem to (cf rsDraw2).
|
||||
margin :: Int -> Int -> Maybe Color -> Widget Name -> Widget Name
|
||||
margin h v mcolour = \w ->
|
||||
Widget Greedy Greedy $ do
|
||||
margin h v mcolour w = Widget Greedy Greedy $ do
|
||||
c <- getContext
|
||||
let w' = vLimit (c^.availHeightL - v*2) $ hLimit (c^.availWidthL - h*2) w
|
||||
attr = maybe currentAttr (\c -> c `on` c) mcolour
|
||||
|
@ -106,7 +106,6 @@ addForm j today = identifyForm "add" $ \extra -> do
|
||||
) ts,
|
||||
"]"
|
||||
]
|
||||
where
|
||||
b64wrap :: Text -> Text
|
||||
b64wrap = ("atob(\""<>) . (<>"\")") . encodeBase64
|
||||
|
||||
|
@ -103,7 +103,7 @@ renderPatch = go Nothing . sortOn fst where
|
||||
go (Just (fp, _)) cs@((sourceFilePath -> fp', _):_) | fp /= fp' = go Nothing cs
|
||||
go (Just (fp, offs)) ((sourceFirstLine -> lineno, diffs):cs) = chunkHeader <> chunk <> go (Just (fp, offs + adds - dels)) cs
|
||||
where
|
||||
chunkHeader = T.pack $ printf "@@ -%d,%d +%d,%d @@\n" lineno dels (lineno+offs) adds where
|
||||
chunkHeader = T.pack $ printf "@@ -%d,%d +%d,%d @@\n" lineno dels (lineno+offs) adds
|
||||
(dels, adds) = foldl' countDiff (0, 0) diffs
|
||||
chunk = foldMap renderLine diffs
|
||||
fileHeader fp = "--- " <> T.pack fp <> "\n+++ " <> T.pack fp <> "\n"
|
||||
|
Loading…
Reference in New Issue
Block a user