This is a program for verifying the correctness of my own Beancount accounts.
The linter can be executed with docker, just mount the directory with your .beancount files into the /data
directory as below:
$ docker run -it --rm -v "/path/to/data-directory:/data" ghcr.io/datavirke/autobean:main /data
The program will print any warnings or issues to stderr.
See the github workflow example
Building uses Docker BuildKit to speed up compilation by caching dependencies and build artifacts, so either enable it in your Docker daemon configuration or preface the below command with DOCKER_BUILDKIT=1
to enable it for the build.
$ docker build -t ghcr.io/datavirke/autobean:test .
Some of the lints make assumptions about the way beancount is being used.
For example, the appendix checks ensure the following:
- All transactions must have a
statement
clause. - Any
statement
clause is a link to an appendix used for auditing purposes, typically a pdf containing invoice or receipt. - Many transactions can refer to the same appendix.
- The format of the
statement
clause isany/prefix-path/YYYY-MM-DD.<Appendix ID>.*
where theYYYY-MM-DD
format is a date, and the Appendix ID:- Is an unsigned integer starting with 1 and incrementing.
- Is unique: that is no two appendices may have the same ID.
- Are sequential. There can be no gaps in the IDs across the entire ledger.