Skip to content

Commit 1b2d887

Browse files
fanquakeClaude Code
authored andcommitted
Merge bitcoin#29537: lint: Misc improvements for lint runner
742d2b9 lint: Add lint runner build dir and lint pycache to clean task (Fabian Jahr) cfa057b lint: Add lint runner build dir to gitignore (Fabian Jahr) fad7f42 lint: Clarify lint runner rust dependency (Fabian Jahr) Pull request description: 1. Document the dependency to rust being installed locally 2. Add the build output directory to gitignore 3. Clean up the build output directory when running `make clean` ACKs for top commit: maflcko: ACK 742d2b9 TheCharlatan: ACK 742d2b9 Tree-SHA512: 36751d852e579830a9e6915b846886a6edaf4e42d508a4773ab502afda10b47c30c7c6bbd3e3158539ea5cf51592c2fe49c4221d271511006653a2d79119ed8c
1 parent d4202b5 commit 1b2d887

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ win32-build
131131
test/config.ini
132132
test/cache/*
133133
test/.mypy_cache/
134+
test/lint/test_runner/target/
134135

135136
!src/leveldb*/Makefile
136137

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ clean-docs:
314314
clean-local: clean-docs
315315
rm -rf coverage_percent.txt test_dash.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
316316
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
317-
rm -rf dist/
317+
rm -rf dist/ test/lint/test_runner/target/ test/lint/__pycache__
318318

319319
test-security-check:
320320
if TARGET_DARWIN

test/lint/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,42 @@ docker run --rm -v $(pwd):/bitcoin -it bitcoin-linter
1717
After building the container once, you can simply run the last command any time you
1818
want to lint.
1919

20+
test runner
21+
===========
22+
23+
To run all the lint checks in the test runner outside the docker you first need
24+
to install the rust toolchain using your package manager of choice or
25+
[rustup](https://www.rust-lang.org/tools/install).
26+
27+
Then you can use:
28+
29+
```sh
30+
( cd ./test/lint/test_runner/ && cargo fmt && cargo clippy && RUST_BACKTRACE=1 cargo run )
31+
```
32+
33+
#### Dependencies
34+
35+
| Lint test | Dependency |
36+
|-----------|:----------:|
37+
| [`lint-python.py`](lint/lint-python.py) | [flake8](https://gitlab.com/pycqa/flake8)
38+
| [`lint-python.py`](lint/lint-python.py) | [lief](https://github.com/lief-project/LIEF)
39+
| [`lint-python.py`](lint/lint-python.py) | [mypy](https://github.com/python/mypy)
40+
| [`lint-python.py`](lint/lint-python.py) | [pyzmq](https://github.com/zeromq/pyzmq)
41+
| [`lint-python-dead-code.py`](lint/lint-python-dead-code.py) | [vulture](https://github.com/jendrikseipp/vulture)
42+
| [`lint-shell.py`](lint/lint-shell.py) | [ShellCheck](https://github.com/koalaman/shellcheck)
43+
| [`lint-spelling.py`](lint/lint-spelling.py) | [codespell](https://github.com/codespell-project/codespell)
44+
45+
In use versions and install instructions are available in the [CI setup](../../ci/lint/04_install.sh).
46+
47+
Please be aware that on Linux distributions all dependencies are usually available as packages, but could be outdated.
48+
49+
#### Running the tests
50+
51+
Individual tests can be run by directly calling the test script, e.g.:
52+
53+
```
54+
test/lint/lint-files.py
55+
```
2056

2157
check-doc.py
2258
============

0 commit comments

Comments
 (0)