|
1
|
# clerk — plain-text accounting toolchain |
|
2
|
|
|
3
|
Go toolkit for ledger/hledger journal files: parsing, linting, formatting, LSP, tags. |
|
4
|
|
|
5
|
## Commands |
|
6
|
```bash |
|
7
|
go build -ldflags="-X 'main.version=dev'" . # build |
|
8
|
go test ./... # all tests |
|
9
|
go test ./internal/linter/ -run TestLinter -v # linter golden suite |
|
10
|
``` |
|
11
|
|
|
12
|
## Conventions |
|
13
|
- **Golden tests:** `testdata/<name>.input` (fixture) + `<name>.golden` (expected), use `internal/testutil/golden.Load/Assert` |
|
14
|
- **semantic.Build(files):** files must be in include-order (includers after includes) |
|
15
|
|
|
16
|
## Boundaries |
|
17
|
- Use `internal/decimal.Decimal` for monetary amounts (no float64) |
|
18
|
- Don't reorder files passed to `semantic.Build` |
|
19
|
|
|
20
|
## Verification |
|
21
|
```bash |
|
22
|
go build ./... && go test ./... |
|
23
|
``` |