1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

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 <walters@verbum.org>
This commit is contained in:
Colin Walters
2024-07-15 17:44:59 -04:00
parent f74eab93b0
commit b26f21788a
3 changed files with 13 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ jobs:
- name: Manpage generation
run: mkdir -p target/man && cargo run --features=docgen -- man --directory target/man
- name: Clippy (gate on correctness and suspicous)
run: cargo clippy -- -D clippy::correctness -D clippy::suspicious
run: make validate-rust
fedora-container-tests:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'control/skip-ci') }}
runs-on: ubuntu-24.04

View File

@@ -85,6 +85,11 @@ For some bootc install commands, it's simpler to run the lldb-server in a contai
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
```
## Code linting
The `make validate` target runs checks locally that we gate on
in CI, currently around `cargo fmt` and `cargo clippy`.
## Running the tests
First, you can run many unit tests with `cargo test`.

View File

@@ -35,9 +35,13 @@ test-bin-archive: all
test-tmt:
cargo xtask test-tmt
validate:
cargo fmt
cargo clippy
# Checks extra rust things (formatting and select clippy lints)
validate-rust:
cargo fmt -- --check -l
cargo clippy -- -D clippy::correctness -D clippy::suspicious
.PHONY: validate-rust
validate: validate-rust
ruff check
.PHONY: validate