Merge bitcoin/bitcoin#34391: lint: upgrade lint scripts for worktrees

5aeaa71c77 lint: pass args from lint.py to cargo run in container (will)
c17a2adb8d lint: upgrade lint scripts for worktrees (will)

Pull request description:

  Fixes #29972

  Use a single script to run the linter locally or in CI.

  Works from inside a worktree.

ACKs for top commit:
  maflcko:
    review ACK 5aeaa71c77 🔒
  davidgumberg:
    code review and lightly tested reACK 5aeaa71
  l0rinc:
    Tested (+ lightly reviewed) ACK 5aeaa71c77

Tree-SHA512: 7c11f649b4752739d31c4f9e6306a98bd2e615b27a0819bbb5e7d9284b9e28bd9f424e145f16361f672f1a63441a1ae2f901c4f99759e997b72a4bf2d56d8d39
This commit is contained in:
merge-script
2026-01-28 09:51:15 +00:00
6 changed files with 96 additions and 68 deletions

View File

@@ -3,20 +3,24 @@ 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.
Extra arguments are passed to `cargo run -- ...` in the container so you can do:
```sh
./ci/lint.py --help
./ci/lint.py --lint=py_lint
```
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).