mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
cln: hlint: Fix redundant return warning.
This commit is contained in:
parent
8bf7cd30ae
commit
1c211f8ab8
@ -50,7 +50,6 @@
|
||||
- ignore: {name: "Redundant bang pattern"}
|
||||
- ignore: {name: "Use zipWith"}
|
||||
- ignore: {name: "Replace case with maybe"}
|
||||
- ignore: {name: "Redundant return"}
|
||||
- ignore: {name: "Avoid lambda using `infix`"}
|
||||
- ignore: {name: "Use <|>"}
|
||||
- ignore: {name: "Use zip"}
|
||||
|
@ -986,7 +986,6 @@ lotpricep = label "ledger-style lot price" $ do
|
||||
lift skipNonNewlineSpaces
|
||||
char '}'
|
||||
when (doublebrace) $ void $ char '}'
|
||||
return ()
|
||||
|
||||
-- Parse a Ledger-style lot date [DATE], and ignore it.
|
||||
-- https://www.ledger-cli.org/3.0/doc/ledger3.html#Fixing-Lot-Prices .
|
||||
|
@ -1266,8 +1266,7 @@ csvFieldValue :: CsvRules -> CsvRecord -> CsvFieldName -> Maybe Text
|
||||
csvFieldValue rules record fieldname = do
|
||||
fieldindex <- if | T.all isDigit fieldname -> readMay $ T.unpack fieldname
|
||||
| otherwise -> lookup (T.toLower fieldname) $ rcsvfieldindexes rules
|
||||
fieldvalue <- T.strip <$> atMay record (fieldindex-1)
|
||||
return fieldvalue
|
||||
T.strip <$> atMay record (fieldindex-1)
|
||||
|
||||
-- | Parse the date string using the specified date-format, or if unspecified
|
||||
-- the "simple date" formats (YYYY/MM/DD, YYYY-MM-DD, YYYY.MM.DD, leading
|
||||
|
@ -134,9 +134,8 @@ words' :: String -> [String]
|
||||
words' "" = []
|
||||
words' s = map stripquotes $ fromparse $ parsewithString p s
|
||||
where
|
||||
p = do ss <- (singleQuotedPattern <|> doubleQuotedPattern <|> patterns) `sepBy` skipNonNewlineSpaces1
|
||||
-- eof
|
||||
return ss
|
||||
p = (singleQuotedPattern <|> doubleQuotedPattern <|> patterns) `sepBy` skipNonNewlineSpaces1
|
||||
-- eof
|
||||
patterns = many (noneOf whitespacechars)
|
||||
singleQuotedPattern = between (char '\'') (char '\'') (many $ noneOf "'")
|
||||
doubleQuotedPattern = between (char '"') (char '"') (many $ noneOf "\"")
|
||||
|
@ -35,7 +35,6 @@ main = do
|
||||
let rates = [0.70, 0.71 .. 1.3]
|
||||
mapM_ (\(n,d,(a,b),c,p) -> putStr $ showtxn n d a b c p) $ take numtxns $ zip5 [1..] dates accts comms (drop 1 comms)
|
||||
mapM_ (\(d,rate) -> putStr $ showmarketprice d rate) $ take numtxns $ zip dates (cycle $ rates ++ init (tail (reverse rates)))
|
||||
return ()
|
||||
|
||||
showtxn :: Int -> Day -> String -> String -> Char -> Char -> String
|
||||
showtxn txnno date acct1 acct2 comm pricecomm =
|
||||
|
@ -20,7 +20,6 @@ main = do
|
||||
today <- getCurrentDay
|
||||
let startdate = addDays (-numentries) today
|
||||
mapM_ (putStr . showentry) [startdate..today]
|
||||
return ()
|
||||
|
||||
showentry d =
|
||||
printf "i %s 09:00:00 dummy\no %s 17:00:00\n" (show d) (show d)
|
||||
|
Loading…
Reference in New Issue
Block a user