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 -> InputOpts
|
||||||
rawOptsToInputOpts day rawopts =
|
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
|
-- Do we really need to do all this work just to get the requested end date? This is duplicating
|
||||||
-- much of reportOptsToSpec.
|
-- much of reportOptsToSpec.
|
||||||
|
|||||||
@ -50,18 +50,18 @@ cliOptsUpdateReportSpecWith roptsupdate copts@CliOpts{reportspec_} =
|
|||||||
|
|
||||||
-- | A type of error check that we can perform on the data.
|
-- | A type of error check that we can perform on the data.
|
||||||
-- Some of these imply other checks that are done first,
|
-- 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.
|
-- and Assertions are always done unless -I is in effect.
|
||||||
data Check =
|
data Check =
|
||||||
-- done always
|
-- done always
|
||||||
Parseable
|
Parseable
|
||||||
| Balancedwithautoconversion
|
| Autobalanced
|
||||||
-- done always unless -I is used
|
-- done always unless -I is used
|
||||||
| Assertions
|
| Assertions
|
||||||
-- done when -s is used, or on demand by check
|
-- done when -s is used, or on demand by check
|
||||||
| Accounts
|
| Accounts
|
||||||
| Commodities
|
| Commodities
|
||||||
| Balancednoautoconversion
|
| Balanced
|
||||||
-- done on demand by check
|
-- done on demand by check
|
||||||
| Ordereddates
|
| Ordereddates
|
||||||
| Payees
|
| Payees
|
||||||
|
|||||||
@ -32,9 +32,8 @@ including `check`:
|
|||||||
- **parseable** - data files are well-formed and can be
|
- **parseable** - data files are well-formed and can be
|
||||||
[successfully parsed](hledger.html#input-files)
|
[successfully parsed](hledger.html#input-files)
|
||||||
|
|
||||||
- **balancedwithautoconversion** - all transactions are [balanced](hledger.html#postings),
|
- **autobalanced** - all transactions are [balanced](hledger.html#postings), after converting to cost.
|
||||||
inferring missing amounts where necessary, and possibly converting commodities
|
Missing amounts and missing [costs] are inferred automatically where possible.
|
||||||
using [costs] or automatically-inferred costs
|
|
||||||
|
|
||||||
- **assertions** - all [balance assertions] in the journal are passing.
|
- **assertions** - all [balance assertions] in the journal are passing.
|
||||||
(This check can be disabled with `-I`/`--ignore-assertions`.)
|
(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
|
- **commodities** - all commodity symbols used
|
||||||
[have been declared](hledger.html#commodity-error-checking)
|
[have been declared](hledger.html#commodity-error-checking)
|
||||||
|
|
||||||
- **balancednoautoconversion** - transactions are balanced, possibly using
|
- **balanced** - all transactions are balanced after converting to cost,
|
||||||
explicit costs but not [inferred ones](#costs)
|
without inferring missing costs.
|
||||||
|
If conversion costs are required, they must be explicit.
|
||||||
|
|
||||||
### Other checks
|
### Other checks
|
||||||
|
|
||||||
|
|||||||
@ -5023,7 +5023,7 @@ This form looks convenient, but there are downsides:
|
|||||||
|
|
||||||
So generally this kind of entry is not recommended.
|
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)),
|
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
|
## Reporting at cost
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
2011/01/01 x
|
2011/01/01 x
|
||||||
a -10£
|
a -10£
|
||||||
b 16$
|
b 16$
|
||||||
$ hledger -f - check balancednoautoconversion
|
$ hledger -f - check balanced
|
||||||
>2 /real postings' sum should be 0 but is: 16\$, -10£/
|
>2 /real postings' sum should be 0 but is: 16\$, -10£/
|
||||||
>=1
|
>=1
|
||||||
@ -123,8 +123,8 @@ Click error names to see an example. The table headings mean:
|
|||||||
|-------------------------------------------------------|------------|------|--------|---------|----------|
|
|-------------------------------------------------------|------------|------|--------|---------|----------|
|
||||||
| [accounts](#accounts) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
| [accounts](#accounts) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||||
| [assertions](#assertions) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
| [assertions](#assertions) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||||
|
| [autobalanced](#autobalanced) | ✓ | ✓ | - | ✓ | ✓ |
|
||||||
| [balanced](#balanced) | ✓ | ✓ | - | ✓ | ✓ |
|
| [balanced](#balanced) | ✓ | ✓ | - | ✓ | ✓ |
|
||||||
| [balancednoautoconversion](#balancednoautoconversion) | ✓ | ✓ | - | ✓ | ✓ |
|
|
||||||
| [commodities](#commodities) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
| [commodities](#commodities) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||||
| [ordereddates](#ordereddates) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
| [ordereddates](#ordereddates) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
||||||
| [parseable](#parseable) | ✓ | ✓ | ✓ | ✓✓ | ✓ |
|
| [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
|
3 | 2022-01-01
|
||||||
| a 1
|
| 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
|
6 | 2022-01-01
|
||||||
| a 1 A
|
| a 1 A
|
||||||
| b -1 B
|
| b -1 B
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
$ hledger check balancednoautoconversion -f balancednoautoconversion.j
|
$ hledger check balanced -f balanced.j
|
||||||
>2 /hledger: Error: .*balancednoautoconversion.j:6-8:
|
>2 /hledger: Error: .*balanced.j:6-8:
|
||||||
6 \| 2022-01-01
|
6 \| 2022-01-01
|
||||||
\| a 1 A
|
\| a 1 A
|
||||||
\| b -1 B
|
\| b -1 B
|
||||||
Loading…
Reference in New Issue
Block a user