cln: hlint: Remove cons warnings.
This commit is contained in:
parent
435fbf001e
commit
71032c637e
@ -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"}
|
||||||
|
|||||||
@ -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.
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -119,18 +119,18 @@ 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)
|
||||||
,pbalanceassertion =
|
,pbalanceassertion =
|
||||||
if islast
|
if islast
|
||||||
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
|
||||||
|
|||||||
@ -278,13 +278,13 @@ compoundBalanceReportAsHtml ropts cbr =
|
|||||||
blankrow = tr_ $ td_ [colspanattr] $ toHtmlRaw (" "::String)
|
blankrow = tr_ $ td_ [colspanattr] $ toHtmlRaw (" "::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 [])
|
||||||
++ (if average_ ropts then ["Average"] else [])
|
++ (if average_ ropts then ["Average"] else [])
|
||||||
]
|
]
|
||||||
|
|
||||||
thRow :: [T.Text] -> Html ()
|
thRow :: [T.Text] -> Html ()
|
||||||
thRow = tr_ . mconcat . map (th_ . toHtml)
|
thRow = tr_ . mconcat . map (th_ . toHtml)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user