test: add an easy way to run linters locally

Adds a Dockerfile configuration
that allows straightforward running of linters with compatible versions
locally. This removes a ton of annoyance when trying to appease CI,
because many of the linter versions are quite old and difficult to
maintain locally.

I realize that people may not be thrilled to more ancillary tooling to
the repo, but I think this makes a lot of sense given the linter
versions listed in this container configuration are dictated by this
repo (within the CI configuration), so having these things live in
two separate places is a recipe for version mismatches.

Eventually we can likely just use this container on CI directly to avoid
any chance of inconsistencies between local dev experience and CI.
This commit is contained in:
James O'Beirne
2023-01-17 11:52:05 -05:00
parent 01ec5308bf
commit dff7ed5732
4 changed files with 80 additions and 18 deletions

View File

@@ -1,5 +1,23 @@
This folder contains lint scripts.
Running locally
===============
To run linters locally with the same versions as the CI environment, use the included
Dockerfile:
```sh
cd ./ci/lint
docker build -t bitcoin-linter .
cd /root/of/bitcoin/repo
docker run --rm -v $(pwd):/bitcoin -it bitcoin-linter
```
After building the container once, you can simply run the last command any time you
want to lint.
check-doc.py
============
Check for missing documentation of command line options.