From 1c86e02d995979a5e538ccdc9a1ccee7b3932e17 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 9 Oct 2025 08:34:59 -1000 Subject: [PATCH] ;dev: journalTransform: doc --- hledger/Hledger/Cli/Utils.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hledger/Hledger/Cli/Utils.hs b/hledger/Hledger/Cli/Utils.hs index b9b88f2e3..aec0befd1 100644 --- a/hledger/Hledger/Cli/Utils.hs +++ b/hledger/Hledger/Cli/Utils.hs @@ -82,10 +82,13 @@ withJournalDo = withJournal -- These happen after parsing, finalising the journal, strict checks, and .latest filtering/updating, -- but before report calculation. They are, in processing order: -- --pivot, --anonymise error message, --obfuscate. +-- +-- Why not do these in journalFinalise ? +-- That step is supposed to check the data's intrinsic correctness, regardless of view options; +-- whereas here we assume correctness and are just transforming the view (based only on InputOpts). +-- XXX But it's easy to forget to call this. Current callers include withJournal, journalReload, uiReload, withJournalCached. journalTransform :: CliOpts -> Journal -> Journal journalTransform opts = --- XXX Called by withJournal, journalReload, uiReload, withJournalCached. --- Could it be moved down into journalFinalise ? These steps only depend on InputOpts. maybePivot opts <&> maybeWarnAboutAnon opts <&> maybeObfuscate opts