Skip to content

Commit

Permalink
Merge pull request #684 from cgwalters/make-check
Browse files Browse the repository at this point in the history
build-sys: Add `make validate-rust`
  • Loading branch information
cgwalters authored Jul 16, 2024
2 parents c866bba + b26f217 commit 604dd9c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 604dd9c

Please sign in to comment.