diff --git a/.hlint.yaml b/.hlint.yaml index 5e6ed11ec..9205d4fb1 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -10,7 +10,6 @@ - ignore: {name: "Move brackets to avoid $"} - ignore: {name: "Redundant $"} - ignore: {name: "Redundant bracket"} -- ignore: {name: "Avoid reverse"} - ignore: {name: "Use sortOn"} - ignore: {name: "Use camelCase"} - ignore: {name: "Use list comprehension"} diff --git a/bin/_hledger-chart.hs b/bin/_hledger-chart.hs index e4af1d8b3..36a187be4 100755 --- a/bin/_hledger-chart.hs +++ b/bin/_hledger-chart.hs @@ -147,7 +147,7 @@ genPie opts (items, _total) = def { _pie_background = solidFillStyle $ opaque $ (samesignitems, sign) = sameSignNonZero items top n t = topn ++ [other] where - (topn,rest) = splitAt n $ reverse $ sortBy (comparing snd) t + (topn,rest) = splitAt n $ sortBy (flip $ comparing snd) t other = ("other", sum $ map snd rest) num = chart_items_ opts hue = if sign > 0 then red else green where (red, green) = (0, 110)