From 4b3abfd4701baeee0e81931bebcfe29c87ab5759 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 16 Jul 2024 11:25:38 +0100 Subject: [PATCH] ;imp: check: recentassertions: improve message readability --- hledger-lib/Hledger/Data/JournalChecks.hs | 9 +++++---- hledger/test/errors/recentassertions.test | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hledger-lib/Hledger/Data/JournalChecks.hs b/hledger-lib/Hledger/Data/JournalChecks.hs index d0c3e5eb2..43fe2ac19 100644 --- a/hledger-lib/Hledger/Data/JournalChecks.hs +++ b/hledger-lib/Hledger/Data/JournalChecks.hs @@ -289,18 +289,19 @@ findRecentAssertionError today ps = do "%s\n", "The recentassertions check is enabled, so accounts with balance assertions must", "have a balance assertion within %d days of their latest posting.", - "In account \"%s\", this posting is %d days later", - "than the last balance assertion, which was on %s.", + "", + "In %s,", + "this posting is %d days later than the balance assertion on %s.", "", "Consider adding a more recent balance assertion for this account. Eg:", "", - "%s\n %s %s0 = %s0 ; (adjust asserted amount)" + "%s\n %s %s0 = %sAMT" ]) f l (textChomp ex) maxlag - acct + (bold' $ T.unpack acct) lag (showDate latestassertdate) (show today) diff --git a/hledger/test/errors/recentassertions.test b/hledger/test/errors/recentassertions.test index 8102e5857..d6609073d 100644 --- a/hledger/test/errors/recentassertions.test +++ b/hledger/test/errors/recentassertions.test @@ -6,6 +6,7 @@ $$$ hledger check recentassertions -f recentassertions.j The recentassertions check is enabled, so accounts with balance assertions must have a balance assertion within 7 days of their latest posting. -In account "a", this posting is 8 days later -than t/ + +In a, +this posting is 8 days later than/ >>>= 1