Merge bitcoin/bitcoin#26906: test: add an easy way to run linters locally

b68e5a7fef lint: specify the right commit range when running locally (James O'Beirne)
dff7ed5732 test: add an easy way to run linters locally (James O'Beirne)

Pull request description:

  Adds a Dockerfile configuration ~~(originally written mostly by fanquake)~~ 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 add 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.

ACKs for top commit:
  aureleoules:
    ACK b68e5a7fef
  stickies-v:
    ACK b68e5a7fe
  john-moffett:
    ACK b68e5a7fef

Tree-SHA512: 7ef7a5dae023d81fdb6296d5d92dfa074ee321c7993e607c9f014d0f21c91558611aa00fc3ce1edc7b5e68371aea0d27fa1931291a79bb867a6c783bb536775f
This commit is contained in:
MarcoFalke
2023-01-19 19:01:18 +01:00
5 changed files with 85 additions and 19 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.