Add cargo fmt --check to CI and local CI

This commit is contained in:
Johnathan Corgan
2026-04-10 08:45:18 +00:00
parent 48b1617497
commit 68bdcb2c75
2 changed files with 18 additions and 0 deletions

View File

@@ -27,6 +27,16 @@ env:
# separate ci-compat.yml workflow so their failures don't mark this run red.
# ─────────────────────────────────────────────────────────────────────────────
jobs:
fmt:
name: Format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}

View File

@@ -153,6 +153,14 @@ run_build() {
return 1
fi
info "cargo fmt --check"
if cargo fmt --check 2>&1; then
record "fmt" 0
else
record "fmt" 1
return 1
fi
info "cargo clippy --all -- -D warnings"
if cargo clippy --all -- -D warnings 2>&1; then
record "clippy" 0