cln: hlint: Remove cons warnings.

This commit is contained in:
Stephen Morgan 2021-08-16 15:38:25 +10:00 committed by Simon Michael
parent 435fbf001e
commit 71032c637e
5 changed files with 28 additions and 35 deletions

View File

@ -21,7 +21,6 @@
- ignore: {name: "Use unless"} - ignore: {name: "Use unless"}
- ignore: {name: "Use any"} - ignore: {name: "Use any"}
- ignore: {name: "Use /="} - ignore: {name: "Use /="}
- ignore: {name: "Use :"}
- ignore: {name: "Use =<<"} - ignore: {name: "Use =<<"}
- ignore: {name: "Use fmap"} - ignore: {name: "Use fmap"}
- ignore: {name: "Use curry"} - ignore: {name: "Use curry"}

View File

@ -400,8 +400,7 @@ journalAccountTypeQuery atypes fallbackregex Journal{jdeclaredaccounttypes} =
concat $ mapMaybe (`M.lookup` jdeclaredaccounttypes) atypes concat $ mapMaybe (`M.lookup` jdeclaredaccounttypes) atypes
in case declaredacctsoftype of in case declaredacctsoftype of
[] -> Acct fallbackregex [] -> Acct fallbackregex
as -> And $ [ Or acctnameRegexes ] as -> And $ Or acctnameRegexes : if null differentlyTypedRegexes then [] else [ Not $ Or differentlyTypedRegexes ]
++ if null differentlyTypedRegexes then [] else [ Not $ Or differentlyTypedRegexes ]
where where
-- XXX Query isn't able to match account type since that requires extra info from the journal. -- XXX Query isn't able to match account type since that requires extra info from the journal.
-- So we do a hacky search by name instead. -- So we do a hacky search by name instead.

View File

@ -576,11 +576,7 @@ defaultOutputFormat :: String
defaultOutputFormat = "txt" defaultOutputFormat = "txt"
outputFormats :: [String] outputFormats :: [String]
outputFormats = outputFormats = [defaultOutputFormat, "csv", "html"]
[defaultOutputFormat] ++
["csv"
,"html"
]
-- | Get the output format from the --output-format option, -- | Get the output format from the --output-format option,
-- otherwise from a recognised file extension in the --output-file option, -- otherwise from a recognised file extension in the --output-file option,

View File

@ -119,7 +119,7 @@ close CliOpts{rawopts_=rawopts, reportspec_=rspec} j = do
closingtxn = nulltransaction{tdate=closingdate, tdescription=closingdesc, tpostings=closingps} closingtxn = nulltransaction{tdate=closingdate, tdescription=closingdesc, tpostings=closingps}
closingps = closingps =
concat [ concat [
[posting{paccount = a posting{paccount = a
,pamount = mixedAmount . precise $ negate b ,pamount = mixedAmount . precise $ negate b
-- after each commodity's last posting, assert 0 balance (#1035) -- after each commodity's last posting, assert 0 balance (#1035)
-- balance assertion amounts are unpriced (#824) -- balance assertion amounts are unpriced (#824)
@ -128,9 +128,9 @@ close CliOpts{rawopts_=rawopts, reportspec_=rspec} j = do
then Just nullassertion{baamount=precise b{aquantity=0, aprice=Nothing}} then Just nullassertion{baamount=precise b{aquantity=0, aprice=Nothing}}
else Nothing else Nothing
} }
]
-- maybe an interleaved posting transferring this balance to equity -- maybe an interleaved posting transferring this balance to equity
++ [posting{paccount=closingacct, pamount=mixedAmount $ precise b} | interleaved] : [posting{paccount=closingacct, pamount=mixedAmount $ precise b} | interleaved]
| -- get the balances for each commodity and transaction price | -- get the balances for each commodity and transaction price
(a,mb) <- acctbals (a,mb) <- acctbals
@ -149,15 +149,14 @@ close CliOpts{rawopts_=rawopts, reportspec_=rspec} j = do
openingtxn = nulltransaction{tdate=openingdate, tdescription=openingdesc, tpostings=openingps} openingtxn = nulltransaction{tdate=openingdate, tdescription=openingdesc, tpostings=openingps}
openingps = openingps =
concat [ concat [
[posting{paccount = a posting{paccount = a
,pamount = mixedAmount $ precise b ,pamount = mixedAmount $ precise b
,pbalanceassertion = ,pbalanceassertion =
case mcommoditysum of case mcommoditysum of
Just s -> Just nullassertion{baamount=precise s{aprice=Nothing}} Just s -> Just nullassertion{baamount=precise s{aprice=Nothing}}
Nothing -> Nothing Nothing -> Nothing
} }
] : [posting{paccount=openingacct, pamount=mixedAmount . precise $ negate b} | interleaved]
++ [posting{paccount=openingacct, pamount=mixedAmount . precise $ negate b} | interleaved]
| (a,mb) <- acctbals | (a,mb) <- acctbals
, let bs = amounts $ normaliseMixedAmount mb , let bs = amounts $ normaliseMixedAmount mb

View File

@ -278,8 +278,8 @@ compoundBalanceReportAsHtml ropts cbr =
blankrow = tr_ $ td_ [colspanattr] $ toHtmlRaw ("&nbsp;"::String) blankrow = tr_ $ td_ [colspanattr] $ toHtmlRaw ("&nbsp;"::String)
titlerows = titlerows =
[tr_ $ th_ [colspanattr, leftattr] $ h2_ $ toHtml title] (tr_ $ th_ [colspanattr, leftattr] $ h2_ $ toHtml title)
++ [thRow $ : [thRow $
"" : ["Commodity" | commodity_column_ ropts] ++ "" : ["Commodity" | commodity_column_ ropts] ++
map (reportPeriodName (balanceaccum_ ropts) colspans) colspans map (reportPeriodName (balanceaccum_ ropts) colspans) colspans
++ (if row_total_ ropts then ["Total"] else []) ++ (if row_total_ ropts then ["Total"] else [])