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

12
ci/lint/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
export LC_ALL=C
# Fixes permission issues when there is a container UID/GID mismatch with the owner
# of the mounted bitcoin src dir.
git config --global --add safe.directory /bitcoin
if [ -z "$1" ]; then
bash -ic "./ci/lint/06_script.sh"
else
exec "$@"
fi