diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e90182..7732183 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,8 @@ jobs: uses: dtolnay/rust-toolchain@master with: toolchain: 1.98.1 + # rustfmt/clippy are actually exercised in the sibling `lint.yml` + # workflow, not here — this job only needs the compiler. components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - name: cargo check --workspace --all-targets diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..61e5673 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,46 @@ +name: lint + +on: + push: + branches: [main] + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +env: + CARGO_TERM_COLOR: always + +jobs: + format: + name: cargo fmt --check + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the + # pinned version lives in exactly ONE place. + components: rustfmt, clippy + - name: cargo fmt --all --check + run: cargo fmt --all --check + + clippy: + name: cargo clippy -D warnings + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the + # pinned version lives in exactly ONE place. + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 + - name: cargo clippy --all-targets -- -D warnings + run: cargo clippy --all-targets -- -D warnings diff --git a/crates/ogar-dismech/src/lib.rs b/crates/ogar-dismech/src/lib.rs index 1266760..25adf82 100644 --- a/crates/ogar-dismech/src/lib.rs +++ b/crates/ogar-dismech/src/lib.rs @@ -832,12 +832,12 @@ mod concept_id_collision_guard { #[test] fn stays_in_the_0x03_ontology_domain_clear_of_documented_bands() { assert_eq!(DISMECH_CONCEPT_ID >> 8, 0x03); - assert!( + const _: () = assert!( DISMECH_CONCEPT_ID > 0x0321, "must clear the documented private-consumer odd-stride run \ (live through 0x031D, retired through 0x0321)" ); - assert!( + const _: () = assert!( DISMECH_CONCEPT_ID < 0x0340, "must clear META_STUDY_SPINE (0x0340..=0x0347)" );