Skip to content

Commit b26f217

Browse files
committed
build-sys: Add make validate-rust
The `make validate-rust` reproduces locally the same checks we run in CI as gating by default; hook it up to the existing `make validate`. Signed-off-by: Colin Walters <[email protected]>
1 parent f74eab9 commit b26f217

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Manpage generation
4949
run: mkdir -p target/man && cargo run --features=docgen -- man --directory target/man
5050
- name: Clippy (gate on correctness and suspicous)
51-
run: cargo clippy -- -D clippy::correctness -D clippy::suspicious
51+
run: make validate-rust
5252
fedora-container-tests:
5353
if: ${{ !contains(github.event.pull_request.labels.*.name, 'control/skip-ci') }}
5454
runs-on: ubuntu-24.04

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ For some bootc install commands, it's simpler to run the lldb-server in a contai
8585
sudo podman run --pid=host --network=host --privileged --security-opt label=type:unconfined_t -v /var/lib/containers:/var/lib/containers -v /dev:/dev -v .:/output localhost/bootc-lldb lldb-server platform --listen "*:1234" --server
8686
```
8787

88+
## Code linting
89+
90+
The `make validate` target runs checks locally that we gate on
91+
in CI, currently around `cargo fmt` and `cargo clippy`.
92+
8893
## Running the tests
8994

9095
First, you can run many unit tests with `cargo test`.

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ test-bin-archive: all
3535
test-tmt:
3636
cargo xtask test-tmt
3737

38-
validate:
39-
cargo fmt
40-
cargo clippy
38+
# Checks extra rust things (formatting and select clippy lints)
39+
validate-rust:
40+
cargo fmt -- --check -l
41+
cargo clippy -- -D clippy::correctness -D clippy::suspicious
42+
.PHONY: validate-rust
43+
44+
validate: validate-rust
4145
ruff check
4246
.PHONY: validate
4347

0 commit comments

Comments
 (0)