rustledger-validate
Beancount validation with 26 error codes for ledger correctness.
Error Categories
| Range | Category |
|---|---|
| E1xxx | Account errors (not opened, already closed, etc.) |
| E2xxx | Balance/pad errors |
| E3xxx | Transaction errors (unbalanced, no postings) |
| E4xxx | Inventory/lot errors |
| E5xxx | Currency/commodity-metadata errors |
| E7xxx | Option errors |
| E8xxx | Document errors |
| E10xxx | Date warnings |
Example
Validation is run through a ValidationSession. Standalone callers
(LSP, FFI, tests on already-booked input) drive the two phases plus
finalize directly; the loader pipeline interleaves booking between
phases.
use ;
use ;
let directives: = vec!;
let today = naive_date.unwrap;
let session = new;
let = session.run_early;
let = session.run_late;
errors.extend;
errors.extend;
for error in errors
The previous free-function shortcuts (validate, validate_with_options)
were removed in #1116 when validation was split around booking. Callers
must now thread state through a ValidationSession so that Phase::Late
sees the inventory state accumulated during Phase::Early.
Features
- Parallel validation with rayon
- Configurable error severity
- Rich error messages with source locations
License
GPL-3.0