mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 01:04:43 +02:00
lint: upgrade lint scripts for worktrees
Add a ci/lint.py script to run the linter both locally or inside the CI (replacing .github/ci-lint-exec.py) which supports running from a worktree. Determines whether we are in a worktree, and mounts the real `.git` directory as a read-only volume if we are.
This commit is contained in:
@@ -3,20 +3,17 @@ This folder contains lint scripts.
|
||||
Running locally
|
||||
===============
|
||||
|
||||
To run linters locally with the same versions as the CI environment, use the included
|
||||
Dockerfile:
|
||||
To run linters locally with the same versions as the CI environment use
|
||||
the _lint.py_ helper script which runs checks inside the CI container:
|
||||
|
||||
```sh
|
||||
DOCKER_BUILDKIT=1 docker build --platform=linux --tag=bitcoin-linter --file="./ci/lint_imagefile" ./ && docker run --rm -v $(pwd):/bitcoin -it bitcoin-linter
|
||||
./ci/lint.py
|
||||
```
|
||||
|
||||
Building the container can be done every time, because it is fast when the
|
||||
result is cached and it prevents issues when the image changes.
|
||||
|
||||
test runner
|
||||
===========
|
||||
|
||||
To run all the lint checks in the test runner outside the docker you first need
|
||||
To run all the lint checks in the test runner outside the container you first need
|
||||
to install the rust toolchain using your package manager of choice or
|
||||
[rustup](https://www.rust-lang.org/tools/install).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user