packages feed

hledger-lib 1.32 → 1.32.1

raw patch · 8 files changed

+63/−26 lines, 8 filesdep ~megaparsecPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: megaparsec

API changes (from Hackage documentation)

+ Hledger.Read: saveLatestDatesForFiles :: [LatestDatesForFile] -> IO ()
+ Hledger.Read.Common: doublequotedtextp :: TextParser m Text
+ Hledger.Utils.IO: readFileStrictly :: FilePath -> IO Text
- Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3L2c => Lens' c_a3L2c BalancingOpts
+ Hledger.Data.Balancing: balancingOpts :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT BalancingOpts
- Hledger.Data.Balancing: class HasBalancingOpts c_a3L2c
+ Hledger.Data.Balancing: class HasBalancingOpts c_a3LeT
- Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3L2c => Lens' c_a3L2c (Maybe (Map CommoditySymbol AmountStyle))
+ Hledger.Data.Balancing: commodity_styles :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT (Maybe (Map CommoditySymbol AmountStyle))
- Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3L2c => Lens' c_a3L2c Bool
+ Hledger.Data.Balancing: ignore_assertions :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT Bool
- Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3L2c => Lens' c_a3L2c Bool
+ Hledger.Data.Balancing: infer_balancing_costs :: HasBalancingOpts c_a3LeT => Lens' c_a3LeT Bool
- Hledger.Read: readJournalFilesAndLatestDates :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO (Journal, LatestDates)
+ Hledger.Read: readJournalFilesAndLatestDates :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO (Journal, [LatestDatesForFile])
- Hledger.Read.Common: aliases :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK [String]
+ Hledger.Read.Common: aliases :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 [String]
- Hledger.Read.Common: anon__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: anon__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: auto__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: auto__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: balancingopts :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK BalancingOpts
+ Hledger.Read.Common: balancingopts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 BalancingOpts
- Hledger.Read.Common: class HasInputOpts c_a3ZDK
+ Hledger.Read.Common: class HasInputOpts c_a3ZN2
- Hledger.Read.Common: forecast :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe DateSpan)
+ Hledger.Read.Common: forecast :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe DateSpan)
- Hledger.Read.Common: infer_costs :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: infer_costs :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: infer_equity :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: infer_equity :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: inputOpts :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK InputOpts
+ Hledger.Read.Common: inputOpts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 InputOpts
- Hledger.Read.Common: ioDay :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Day
+ Hledger.Read.Common: ioDay :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Day
- Hledger.Read.Common: mformat :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe StorageFormat)
+ Hledger.Read.Common: mformat :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe StorageFormat)
- Hledger.Read.Common: mrules_file :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe FilePath)
+ Hledger.Read.Common: mrules_file :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe FilePath)
- Hledger.Read.Common: new__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: new__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: new_save :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: new_save :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: pivot :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK String
+ Hledger.Read.Common: pivot :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 String
- Hledger.Read.Common: reportspan :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK DateSpan
+ Hledger.Read.Common: reportspan :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 DateSpan
- Hledger.Read.Common: strict :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: strict :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.Common: verbose_tags :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK [String]
+ Hledger.Read.InputOptions: aliases :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 [String]
- Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: anon__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: auto__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK BalancingOpts
+ Hledger.Read.InputOptions: balancingopts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 BalancingOpts
- Hledger.Read.InputOptions: class HasInputOpts c_a3ZDK
+ Hledger.Read.InputOptions: class HasInputOpts c_a3ZN2
- Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe DateSpan)
+ Hledger.Read.InputOptions: forecast :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe DateSpan)
- Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: infer_costs :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: infer_equity :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK InputOpts
+ Hledger.Read.InputOptions: inputOpts :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 InputOpts
- Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Day
+ Hledger.Read.InputOptions: ioDay :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Day
- Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe StorageFormat)
+ Hledger.Read.InputOptions: mformat :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe StorageFormat)
- Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK (Maybe FilePath)
+ Hledger.Read.InputOptions: mrules_file :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 (Maybe FilePath)
- Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: new__ :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: new_save :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK String
+ Hledger.Read.InputOptions: pivot :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 String
- Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK DateSpan
+ Hledger.Read.InputOptions: reportspan :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 DateSpan
- Hledger.Read.InputOptions: strict :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: strict :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3ZDK => Lens' c_a3ZDK Bool
+ Hledger.Read.InputOptions: verbose_tags :: HasInputOpts c_a3ZN2 => Lens' c_a3ZN2 Bool
- Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW AccountListMode
+ Hledger.Reports.ReportOptions: accountlistmode :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe AccountListMode
- Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: average :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW BalanceAccumulation
+ Hledger.Reports.ReportOptions: balanceaccum :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe BalanceAccumulation
- Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW BalanceCalculation
+ Hledger.Reports.ReportOptions: balancecalc :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe BalanceCalculation
- Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW (Maybe Text)
+ Hledger.Reports.ReportOptions: budgetpat :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe Text)
- Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a47FW
+ Hledger.Reports.ReportOptions: class HasReportOptsNoUpdate c_a47Pe
- Hledger.Reports.ReportOptions: class HasReportSpec c_a48GE
+ Hledger.Reports.ReportOptions: class HasReportSpec c_a48PW
- Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: color__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW (Maybe ConversionOp)
+ Hledger.Reports.ReportOptions: conversionop :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe ConversionOp)
- Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: date2NoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: declared :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW (Maybe Int)
+ Hledger.Reports.ReportOptions: depthNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe Int)
- Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Int
+ Hledger.Reports.ReportOptions: drop__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Int
- Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: empty__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW StringFormat
+ Hledger.Reports.ReportOptions: format :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe StringFormat
- Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: infer_prices :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Interval
+ Hledger.Reports.ReportOptions: interval :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Interval
- Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: invert :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Layout
+ Hledger.Reports.ReportOptions: layout :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Layout
- Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: no_elide :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: no_total :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW (Maybe NormalSign)
+ Hledger.Reports.ReportOptions: normalbalance :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe NormalSign)
- Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: percent :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Period
+ Hledger.Reports.ReportOptions: periodNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Period
- Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: pretty :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW [Text]
+ Hledger.Reports.ReportOptions: querystringNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe [Text]
- Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: realNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: related :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW ReportOpts
+ Hledger.Reports.ReportOptions: reportOptsNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe ReportOpts
- Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a48GE => Lens' c_a48GE ReportSpec
+ Hledger.Reports.ReportOptions: reportSpec :: HasReportSpec c_a48PW => Lens' c_a48PW ReportSpec
- Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: row_total :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a48GE => Lens' c_a48GE Day
+ Hledger.Reports.ReportOptions: rsDay :: HasReportSpec c_a48PW => Lens' c_a48PW Day
- Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a48GE => Lens' c_a48GE Query
+ Hledger.Reports.ReportOptions: rsQuery :: HasReportSpec c_a48PW => Lens' c_a48PW Query
- Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a48GE => Lens' c_a48GE [QueryOpt]
+ Hledger.Reports.ReportOptions: rsQueryOpts :: HasReportSpec c_a48PW => Lens' c_a48PW [QueryOpt]
- Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a48GE => Lens' c_a48GE ReportOpts
+ Hledger.Reports.ReportOptions: rsReportOpts :: HasReportSpec c_a48PW => Lens' c_a48PW ReportOpts
- Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: show_costs :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: sort_amount :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW [Status]
+ Hledger.Reports.ReportOptions: statusesNoUpdate :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe [Status]
- Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: summary_only :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: transpose__ :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW Bool
+ Hledger.Reports.ReportOptions: txn_dates :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe Bool
- Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a47FW => Lens' c_a47FW (Maybe ValuationType)
+ Hledger.Reports.ReportOptions: value :: HasReportOptsNoUpdate c_a47Pe => Lens' c_a47Pe (Maybe ValuationType)

Files

CHANGES.md view
@@ -13,6 +13,10 @@ Internal/api/developer-ish changes in the hledger-lib (and hledger) packages. For user-visible changes, see the hledger package changelog. +# 1.32.1 2023-12-07++- readFileStrictly is now provided by Hledger.Utils.IO+ # 1.32 2023-12-01  Misc. changes
Hledger/Data/Balancing.hs view
@@ -664,7 +664,6 @@         -- "display precision:  %d",         "this balance was asserted:     %s", -- (at display precision: %s)",         "but the calculated balance is: %s", -- (at display precision: %s)",-        "a difference of:               %s",         "",         "To troubleshoot, you can view this account's running balance. Eg:",         "",@@ -680,7 +679,7 @@       -- (showAmount assertedamt)       (show $ aquantity actualbalincomm)       -- (showAmount actualbalincommodity)-      (show $ aquantity assertedamt - aquantity actualbalincomm)+      -- (show $ aquantity assertedamt - aquantity actualbalincomm)       (acct ++ if isinclusive then "" else "$")       (if istotal then "" else (" cur:" ++ quoteForCommandLine (T.unpack assertedcomm)))       where
Hledger/Data/JournalChecks.hs view
@@ -186,7 +186,7 @@                     -- where                     --   col  = T.length (showTransactionLineFirstPart txn') + 2                     --   col2 = col + T.length tagname - 1-    declaredtags = journalTagsDeclared j+    declaredtags = journalTagsDeclared j ++ builtinTags     msg = (unlines [       "%s:%d:"       ,"%s"@@ -196,6 +196,19 @@       ,""       ,"tag %s"       ])++-- | Tag names which have special significance to hledger.+builtinTags = [+   "type"  -- declares an account's type+  ,"t"     -- generated by timedot letters notation+  -- optionally generated on periodic transactions and auto postings+  ,"generated-transaction"+  ,"generated-posting"+  -- used internally, not shown (but queryable)+  ,"_generated-transaction"+  ,"_generated-posting"+  ,"_conversion-matched"+  ]  -- | In each tranaction, check that any conversion postings occur in adjacent pairs. journalCheckPairedConversionPostings :: Journal -> Either String ()
Hledger/Read.hs view
@@ -109,6 +109,7 @@   -- * Misc   journalStrictChecks,   saveLatestDates,+  saveLatestDatesForFiles,    -- * Re-exported   JournalReader.tmpostingrulep,@@ -132,7 +133,7 @@ import Data.Foldable (asum) import Data.List (group, sort, sortBy) import Data.List.NonEmpty (nonEmpty)-import Data.Maybe (fromMaybe)+import Data.Maybe (catMaybes, fromMaybe) import Data.Ord (comparing) import Data.Semigroup (sconcat) import Data.Text (Text)@@ -243,15 +244,17 @@ -- readJournalFile :: InputOpts -> PrefixedFilePath -> ExceptT String IO Journal readJournalFile iopts@InputOpts{new_, new_save_} prefixedfile = do-  (j,latestdates) <- readJournalFileAndLatestDates iopts prefixedfile+  (j, mlatestdates) <- readJournalFileAndLatestDates iopts prefixedfile   when (new_ && new_save_) $ liftIO $-    saveLatestDates latestdates (snd $ splitReaderPrefix prefixedfile)+    case mlatestdates of+      Nothing                        -> return ()+      Just (LatestDatesForFile f ds) -> saveLatestDates ds f   return j --- The implementation of readJournalFile, but with --new, --- also returns the latest transaction date(s) read.--- Used by readJournalFiles, to save those at the end.-readJournalFileAndLatestDates :: InputOpts -> PrefixedFilePath -> ExceptT String IO (Journal,LatestDates)+-- The implementation of readJournalFile.+-- With --new, it also returns the latest transaction date(s) read from each file.+-- readJournalFiles uses this to update .latest files only after a successful read of all.+readJournalFileAndLatestDates :: InputOpts -> PrefixedFilePath -> ExceptT String IO (Journal, Maybe LatestDatesForFile) readJournalFileAndLatestDates iopts prefixedfile = do   let     (mfmt, f) = splitReaderPrefix prefixedfile@@ -266,9 +269,9 @@     then do       ds <- liftIO $ previousLatestDates f       let (newj, newds) = journalFilterSinceLatestDates ds j-      return (newj, newds)+      return (newj, Just $ LatestDatesForFile f newds)     else-      return (j, [])+      return (j, Nothing)  -- | Read a Journal from each specified file path (using @readJournalFile@)  -- and combine them into one; or return the first error message.@@ -285,20 +288,20 @@ readJournalFiles :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO Journal readJournalFiles iopts@InputOpts{strict_,new_,new_save_} prefixedfiles = do   let iopts' = iopts{strict_=False, new_save_=False}-  (j,latestdates) <-+  (j, latestdatesforfiles) <-     traceOrLogAt 6 ("readJournalFiles: "++show prefixedfiles) $     readJournalFilesAndLatestDates iopts' prefixedfiles   when strict_ $ liftEither $ journalStrictChecks j-  when (new_ && new_save_) $ liftIO $-    mapM_ (saveLatestDates latestdates . snd . splitReaderPrefix) prefixedfiles+  when (new_ && new_save_) $ liftIO $ saveLatestDatesForFiles latestdatesforfiles   return j  -- The implementation of readJournalFiles, but with --new,  -- also returns the latest transaction date(s) read in each file. -- Used by the import command, to save those at the end.-readJournalFilesAndLatestDates :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO (Journal,LatestDates)-readJournalFilesAndLatestDates iopts =-  fmap (maybe def sconcat . nonEmpty) . mapM (readJournalFileAndLatestDates iopts)+readJournalFilesAndLatestDates :: InputOpts -> [PrefixedFilePath] -> ExceptT String IO (Journal, [LatestDatesForFile])+readJournalFilesAndLatestDates iopts pfs = do+  (js, lastdates) <- unzip <$> mapM (readJournalFileAndLatestDates iopts) pfs+  return (maybe def sconcat $ nonEmpty js, catMaybes lastdates)  -- | Run the extra -s/--strict checks on a journal, -- returning the first error message if any of them fail.@@ -371,6 +374,9 @@ -- and how many transactions there were on that date. type LatestDates = [Day] +-- The path of an input file, and its current "LatestDates".+data LatestDatesForFile = LatestDatesForFile FilePath LatestDates+ -- | Get all instances of the latest date in an unsorted list of dates. -- Ie, if the latest date appears once, return it in a one-element list, -- if it appears three times (anywhere), return three of it.@@ -383,6 +389,10 @@ saveLatestDates :: LatestDates -> FilePath -> IO () saveLatestDates dates f = T.writeFile (latestDatesFileFor f) $ T.unlines $ map showDate dates +-- | Save each file's latest dates.+saveLatestDatesForFiles :: [LatestDatesForFile] -> IO ()+saveLatestDatesForFiles = mapM_ (\(LatestDatesForFile f ds) -> saveLatestDates ds f)+ -- | What were the latest transaction dates seen the last time this -- journal file was read ? If there were multiple transactions on the -- latest date, that number of dates is returned, otherwise just one.@@ -404,9 +414,6 @@ latestDatesFileFor f = dir </> ".latest" <.> fname   where     (dir, fname) = splitFileName f--readFileStrictly :: FilePath -> IO Text-readFileStrictly f = readFilePortably f >>= \t -> C.evaluate (T.length t) >> return t  -- | Given zero or more latest dates (all the same, representing the -- latest previously seen transaction date, and how many transactions
Hledger/Read/Common.hs view
@@ -105,6 +105,7 @@   bracketeddatetagsp,    -- ** misc+  doublequotedtextp,   noncommenttextp,   noncommenttext1p,   singlespacedtext1p,@@ -657,6 +658,11 @@ -- for now it remains as-is for backwards compatibility. accountnamep :: TextParser m AccountName accountnamep = singlespacedtext1p++-- | Parse a single line of possibly empty text enclosed in double quotes.+doublequotedtextp :: TextParser m Text+doublequotedtextp = between (char '"') (char '"') $+  takeWhileP Nothing $ \c -> not $ isNewline c || c == '"'  -- | Parse possibly empty text, including whitespace,  -- until a comment start (semicolon) or newline.
Hledger/Read/JournalReader.hs view
@@ -629,7 +629,7 @@ payeedirectivep = do   string "payee" <?> "payee directive"   lift skipNonNewlineSpaces1-  payee <- lift $ T.strip <$> noncommenttext1p+  payee <- lift $ T.strip <$> (try doublequotedtextp <|> noncommenttext1p)   (comment, tags) <- lift transactioncommentp   skipMany indentedlinep   addPayeeDeclaration (payee, comment, tags)@@ -1134,8 +1134,10 @@       }    ,testGroup "payeedirectivep" [-       testCase "simple"             $ assertParse payeedirectivep "payee foo\n"+        testCase "simple"             $ assertParse payeedirectivep "payee foo\n"        ,testCase "with-comment"       $ assertParse payeedirectivep "payee foo ; comment\n"+       ,testCase "double-quoted"      $ assertParse payeedirectivep "payee \"a b\"\n"+       ,testCase "empty        "      $ assertParse payeedirectivep "payee \"\"\n"        ]    ,testCase "tagdirectivep" $ do
Hledger/Utils/IO.hs view
@@ -9,7 +9,7 @@  -} -{-# LANGUAGE CPP, LambdaCase #-}+{-# LANGUAGE CPP, LambdaCase, PackageImports #-}  module Hledger.Utils.IO ( @@ -80,6 +80,7 @@   expandGlob,   sortByModTime,   readFileOrStdinPortably,+  readFileStrictly,   readFilePortably,   readHandlePortably,   -- hereFileRelative,@@ -91,6 +92,7 @@   ) where +import qualified Control.Exception as C (evaluate) import           Control.Monad (when, forM) import           Data.Colour.RGBSpace (RGB(RGB)) import           Data.Colour.RGBSpace.HSL (lightness)@@ -125,7 +127,7 @@   defaultOutputOptionsDarkBg, defaultOutputOptionsNoColor, pShowOpt, pPrintOpt)  import Hledger.Utils.Text (WideBuilder(WideBuilder))-import System.FilePath.Glob (glob)+import "Glob" System.FilePath.Glob (glob) import Data.Functor ((<&>))  -- Pretty showing/printing with pretty-simple@@ -460,6 +462,10 @@ sortByModTime fs = do   ftimes <- forM fs $ \f -> do {t <- getModificationTime f; return (t,f)}   return $ map snd $ reverse $ sort ftimes++-- | Like readFilePortably, but read all of the file before proceeding.+readFileStrictly :: FilePath -> IO T.Text+readFileStrictly f = readFilePortably f >>= \t -> C.evaluate (T.length t) >> return t  -- | Read text from a file, -- converting any \r\n line endings to \n,,
hledger-lib.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           hledger-lib-version:        1.32+version:        1.32.1 synopsis:       A library providing the core functionality of hledger description:    This library contains hledger's core functionality.                 It is used by most hledger* packages so that they support the same