From a11d461e76fa91b2b8d339631048e8863104dcab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DomRift=20=E2=9A=A1=EF=B8=8F=F0=9F=92=BB?= <119934253+Macnelson9@users.noreply.github.com> Date: Sun, 31 May 2026 13:03:12 +0000 Subject: [PATCH] feat(ci): enforce Clippy + rustfmt on every Rust PR (#70) Adds `.github/workflows/rust-lint.yml` with two jobs: - `clippy`: runs `cargo clippy -- -D warnings` - `rustfmt`: runs `cargo fmt --all -- --check` Triggers on push/PR touching `src/**`, `Cargo.toml`, or `Cargo.lock`. Uses `Swatinem/rust-cache` for fast CI. Closes #70 Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/rust-lint.yml | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/rust-lint.yml diff --git a/.github/workflows/rust-lint.yml b/.github/workflows/rust-lint.yml new file mode 100644 index 0000000..55d75ca --- /dev/null +++ b/.github/workflows/rust-lint.yml @@ -0,0 +1,44 @@ +name: Rust Lint + +on: + push: + paths: + - "src/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-lint.yml" + pull_request: + paths: + - "src/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-lint.yml" + +jobs: + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Run clippy + run: cargo clippy -- -D warnings + + rustfmt: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + + - name: Check formatting + run: cargo fmt --all -- --check