Commit Graph

12 Commits

Author SHA1 Message Date
Simon Michael
b15a634a44 ;check: accept parseable/autobalanced/assertions as arguments, for completeness 2021-01-05 16:25:43 -08:00
Simon Michael
7510d99aec check: accept case-insensitive prefixes as arguments
Might a bad idea, but avoiding wasteful typing..
2021-01-05 16:18:24 -08:00
Simon Michael
4491325bb0 ;check: ordereddates/uniqueleafnames: print on stderr, refactor 2020-12-31 11:22:32 -08:00
Simon Michael
1d4c4c5b8b check: drop old checkdates/checkdupes commands, consolidate 2020-12-31 10:49:17 -08:00
Simon Michael
8306420b61 check: also check "accounts"/"commodities" on demand
(cherry picked from commit 0c2bf54f2955e3a25fd0282acc42608f957abaea)
2020-12-31 08:33:36 -08:00
Simon Michael
31ea37a785 ;check: accounts, commodities, payees, ordereddates: improve errors
Error messages for these four are now a bit fancier and more
consistent. But not yet optimised for machine readability.
Cf #1436.

Added to hledger-lib: chomp1, linesPrepend[2].
2020-12-30 18:13:34 -08:00
Damien Cassou
b47d582583 ;check: fixes 2020-12-30 18:08:31 -08:00
Simon Michael
3c232fbd7d check: add "payees" check requiring payee declarations 2020-12-30 18:08:30 -08:00
Simon Michael
349ffd7c0b updateReportSpecFromOpts -> updateReportSpec[With] 2020-12-12 12:05:44 -08:00
Simon Michael
090e810761 check: rename ordereddates, uniqueleafnames 2020-11-30 08:26:48 -08:00
Simon Michael
e33667f580 check: support quoted check name + args
A "hledger check" argument may now be a quoted string containing
the check name followed by space-separated arguments, for
checks which make use of those. This means the check command
can replicate "check-dates --unique" and (in principle)
"check-fancyassertions ASSERTIONS..". Eg:

hledger check "dates --unique"

I think it'll be better for checks to take no arguments or options,
so this is probably just a transitional feature for compatibility.
2020-11-29 20:48:31 -08:00
Simon Michael
724fb9961d check: new command incorporating check-dates, check-dupes, etc.
This is intended to work in three modes:

- hledger check: just run the standard data checks, like all other
commands but with no output on success. Equivalent to
hledger stats >/dev/null but simpler and platform-independent.

- hledger check --strict: run the standard + strict data checks,
like other commands in strict mode.

- hledger check CHECK1 CHECK2 ...: run the named checks. This allows
running more or less checks than the default or strict mode, or
a single check of interest. The arguments are standard lowercase names
for the checks. For now this command supports two checks: "dates" and
"leafnames". These are equivalent to the check-dates and check-dupes
commands which are now hidden and considered deprecated, though
still supported for the moment.

This command needs more work and I'm rushing it a little, but I think
it's the right direction and I'd like to put it out there to get
feedback.
2020-11-29 13:27:35 -08:00