-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imp:check:recentassertions: give a more useful error location
hledger check recentassertions now reports the error at the first posting that's more than 7 days later than the latest balance assertion (rather than at the balance assertion). This is the thing actually triggering the error, and it is more likely to be visible or at least closer when you are working at the end of a journal file.
- Loading branch information
1 parent
2f64c3e
commit 002773f
Showing
4 changed files
with
79 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
#!/usr/bin/env -S hledger check recentassertions -f | ||
# Latest balance assertion more than 7 days behind latest posting. | ||
# Postings more than 7 days after latest balance assertion. | ||
|
||
2022-01-01 * | ||
a 0 = 0 | ||
|
||
2022-01-09 * | ||
2022-01-08 good | ||
a 0 | ||
|
||
2022-01-09 bad1 | ||
a 0 | ||
|
||
2022-01-10 bad2 | ||
a 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
$ hledger check recentassertions -f recentassertions.j | ||
>2 /hledger: Error: .*recentassertions.j:5:8: | ||
\| 2022-01-01 \* | ||
5 \| a 0 = 0 | ||
\| \^\^\^ | ||
|
||
The recentassertions check is enabled, so accounts with balance assertions must | ||
have a balance assertion no more than 7 days before their latest posting date. | ||
In account a, | ||
>2 /Error: .*recentassertions.j:11: | ||
| 2022-01-09 bad1 | ||
11 | a 0 | ||
| \^ | ||
/ | ||
>= 1 | ||
# | ||
#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", the above posting is 8 days later | ||
#than the last balance assertion, which was on 2022-01-01. | ||
# | ||
#Consider adding a more recent balance assertion for this account. Eg: | ||
# | ||
#....-..-.. | ||
# a \$0 = \$0 ; \(adjust asserted amount\) | ||
#/ | ||
#>= 1 | ||
# XXX shelltestrunner: "ERROR: please avoid regexps larger than 300 characters, they trigger a memory leak in regex-tdfa". | ||
# Still true ? |