imp:check: more intuitive "balanced..." check names
balancedwithautoconversion -> autobalanced balancednoautoconversion -> balanced
This commit is contained in:
parent
273c51165e
commit
5f1bf0404a
@ -193,7 +193,7 @@ instance Show (Reader m) where show r = rFormat r ++ " reader"
|
||||
rawOptsToInputOpts :: Day -> RawOpts -> InputOpts
|
||||
rawOptsToInputOpts day rawopts =
|
||||
|
||||
let noinferbalancingcosts = boolopt "strict" rawopts || stringopt "args" rawopts == "balancednoautoconversion"
|
||||
let noinferbalancingcosts = boolopt "strict" rawopts || stringopt "args" rawopts == "balanced"
|
||||
|
||||
-- Do we really need to do all this work just to get the requested end date? This is duplicating
|
||||
-- much of reportOptsToSpec.
|
||||
|
||||
@ -50,18 +50,18 @@ cliOptsUpdateReportSpecWith roptsupdate copts@CliOpts{reportspec_} =
|
||||
|
||||
-- | A type of error check that we can perform on the data.
|
||||
-- Some of these imply other checks that are done first,
|
||||
-- eg currently Parseable and Balancedwithautoconversion are always done,
|
||||
-- eg currently Parseable and Autobalanced are always done,
|
||||
-- and Assertions are always done unless -I is in effect.
|
||||
data Check =
|
||||
-- done always
|
||||
Parseable
|
||||
| Balancedwithautoconversion
|
||||
| Autobalanced
|
||||
-- done always unless -I is used
|
||||
| Assertions
|
||||
-- done when -s is used, or on demand by check
|
||||
| Accounts
|
||||
| Commodities
|
||||
| Balancednoautoconversion
|
||||
| Balanced
|
||||
-- done on demand by check
|
||||
| Ordereddates
|
||||
| Payees
|
||||
|
||||
@ -32,9 +32,8 @@ including `check`:
|
||||
- **parseable** - data files are well-formed and can be
|
||||
[successfully parsed](hledger.html#input-files)
|
||||
|
||||
- **balancedwithautoconversion** - all transactions are [balanced](hledger.html#postings),
|
||||
inferring missing amounts where necessary, and possibly converting commodities
|
||||
using [costs] or automatically-inferred costs
|
||||
- **autobalanced** - all transactions are [balanced](hledger.html#postings), after converting to cost.
|
||||
Missing amounts and missing [costs] are inferred automatically where possible.
|
||||
|
||||
- **assertions** - all [balance assertions] in the journal are passing.
|
||||
(This check can be disabled with `-I`/`--ignore-assertions`.)
|
||||
@ -50,8 +49,9 @@ Or, they can be run by giving their names as arguments to `check`:
|
||||
- **commodities** - all commodity symbols used
|
||||
[have been declared](hledger.html#commodity-error-checking)
|
||||
|
||||
- **balancednoautoconversion** - transactions are balanced, possibly using
|
||||
explicit costs but not [inferred ones](#costs)
|
||||
- **balanced** - all transactions are balanced after converting to cost,
|
||||
without inferring missing costs.
|
||||
If conversion costs are required, they must be explicit.
|
||||
|
||||
### Other checks
|
||||
|
||||
|
||||
@ -5023,7 +5023,7 @@ This form looks convenient, but there are downsides:
|
||||
|
||||
So generally this kind of entry is not recommended.
|
||||
You can make sure you have none of these by using `-s` ([strict mode](#strict-mode)),
|
||||
or by running `hledger check balancednoautoconversion`.
|
||||
or by running `hledger check balanced`.
|
||||
|
||||
## Reporting at cost
|
||||
|
||||
|
||||
@ -3,6 +3,6 @@
|
||||
2011/01/01 x
|
||||
a -10£
|
||||
b 16$
|
||||
$ hledger -f - check balancednoautoconversion
|
||||
$ hledger -f - check balanced
|
||||
>2 /real postings' sum should be 0 but is: 16\$, -10£/
|
||||
>=1
|
||||
@ -123,8 +123,8 @@ Click error names to see an example. The table headings mean:
|
||||
|-------------------------------------------------------|------------|------|--------|---------|----------|
|
||||
| [accounts](#accounts) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||
| [assertions](#assertions) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||
| [autobalanced](#autobalanced) | ✓ | ✓ | - | ✓ | ✓ |
|
||||
| [balanced](#balanced) | ✓ | ✓ | - | ✓ | ✓ |
|
||||
| [balancednoautoconversion](#balancednoautoconversion) | ✓ | ✓ | - | ✓ | ✓ |
|
||||
| [commodities](#commodities) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||
| [ordereddates](#ordereddates) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||
| [parseable](#parseable) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||
@ -194,9 +194,9 @@ hledger reg 'a$' cur: -I # -f FILE
|
||||
```
|
||||
|
||||
|
||||
### balanced
|
||||
### autobalanced
|
||||
```
|
||||
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./balanced.j:3-4:
|
||||
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./autobalanced.j:3-4:
|
||||
3 | 2022-01-01
|
||||
| a 1
|
||||
|
||||
@ -206,9 +206,9 @@ Consider adjusting this entry's amounts, or adding missing postings.
|
||||
```
|
||||
|
||||
|
||||
### balancednoautoconversion
|
||||
### balanced
|
||||
```
|
||||
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./balancednoautoconversion.j:6-8:
|
||||
hledger: Error: /Users/simon/src/hledger/hledger/test/errors/./balanced.j:6-8:
|
||||
6 | 2022-01-01
|
||||
| a 1 A
|
||||
| b -1 B
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
$ hledger check balancednoautoconversion -f balancednoautoconversion.j
|
||||
>2 /hledger: Error: .*balancednoautoconversion.j:6-8:
|
||||
$ hledger check balanced -f balanced.j
|
||||
>2 /hledger: Error: .*balanced.j:6-8:
|
||||
6 \| 2022-01-01
|
||||
\| a 1 A
|
||||
\| b -1 B
|
||||
Loading…
Reference in New Issue
Block a user