Open pwseo opened 3 weeks ago
I'd be happy to test a PR exploring this. Some checks are relatively easy to continue from on failure; others are not.
But I don't find it causing pain in practice, do you ? I don't have a slow edit-check-fix cycle.
I'd be happy to test a PR exploring this. Some checks are relatively easy to continue from on failure; others are not.
Maybe one day. Right now my Haskell skills are subpar and I have no familiarity with hledger's code base (sadly). I'll try and change that in the future.
But I don't find it causing pain in practice, do you ? I don't have a slow edit-check-fix cycle.
In a carefully maintained chart of accounts this isn't problematic (especially if one has some kind of auto-complete for account names), but scenarios vary. I recently started tracking my finances with hledger and there was a lot of checking and fixing to do in the beginning (because my chart of accounts wasn't fully developed).
Still, on a more general note, I think having the check
command try and report as many errors as it can is a positive change, while passing the --strict
flag should still quit after the first error is found.
Not detracting from your point, but remember strict account checking is optional and simply avoiding it is another option when the chart of accounts hasn't yet stabilised.
Yes, I know, but strictness checking is also the only way to know which accounts have not been declared and are being used. One can always get the used accounts' listing from a non-strict hledger accounts
, but it has its downsides.
Thank you for the suggestion, though.
Currently, if one turns on strict mode or uses the check command (eg.
check accounts
,check payees
), hledger stops after the first undeclared account/payee is encountered.While this is technically correct, it makes one repeat the edit-check-fix cycle more times than should be needed.
Here's an example:
As it stands, we have 2 undeclared accounts and 2 undeclared payees. Let's check them with
hledger
:The same thing happens for payees:
hledger
never sees payeeB
and thus never complains about it because it quits after reportingA
is not declared.I think it would be helpful if hledger continued processing the data and collected as much undeclared accounts / payees as possible before presenting them to the user. Perhaps this would not belong in the
-s
argument's default behaviour (so as not to overwhelm new users), but only in the explicitcheck
command (it does make sense to report all undeclared accounts if I ask tocheck accounts
, I think).