From 8624da00576307e01178507734fc39817d2d37e4 Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 17 Jul 2026 01:39:36 +0200 Subject: [PATCH] fix(#2550): make pedantic clippy lints a hard error, fix stale checks.nix comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clippy check's comment described `-D warnings -A clippy::pedantic` — the `-A` half dropping pedantic from the CI gate — but the args were only `-D warnings`, so pedantic was hard-denied contrary to the doc. Operator call: pedantic should be gated. Encode that as the single source of truth: set the workspace lint `pedantic = deny` (errors locally and in CI), and rewrite the checks.nix comment to match. Args unchanged; `-D warnings` still gates rustc + non-pedantic clippy warnings. No new failures — the tree was already pedantic-clean under CI's `-D warnings`, which denied pedantic. --- Cargo.toml | 6 +++++- nix/checks.nix | 19 ++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index be63ad94..e671ba8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,11 @@ edition = "2024" version = "0.1.0" [workspace.lints.clippy] -pedantic = { level = "warn", priority = -1 } +# Pedantic is a hard error (locally + in CI): we want pedantic lints +# gated, so a toolchain bump that adds a new one reds the build until the +# code is updated rather than sliding in unnoticed. Priority -1 keeps the +# specific allows below winning over the group. +pedantic = { level = "deny", priority = -1 } # Tolerated stylistic pedantic lints (noisy, not actionable). missing_errors_doc = "allow" missing_panics_doc = "allow" diff --git a/nix/checks.nix b/nix/checks.nix index 2d5bb1d6..4c0d348a 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -19,17 +19,14 @@ in # shared `cargoArtifacts` (deps already built) and runs # `cargo clippy --workspace --all-targets` directly. # - # `-D warnings` makes the default/correctness/style lints a - # hard CI gate. `-A clippy::pedantic` then drops the pedantic - # group from that gate: pedantic is the "extra, opinionated" - # group the clippy team grows freely, so denying it means - # every toolchain bump that adds a new pedantic lint breaks CI - # with zero code changes. The `pedantic = warn` - # workspace lint (Cargo.toml) keeps it as advisory signal in - # local `cargo clippy` — it just no longer blocks the build. - # (`-A` rather than `-W` here: `-W clippy::pedantic` would - # re-enable the specific pedantic lints the workspace lints - # table allows, e.g. `must_use_candidate`.) + # `-D warnings` makes every rustc/clippy warning a hard CI gate. + # Pedantic is gated too, deliberately: the workspace lint table + # (Cargo.toml) sets `pedantic = deny`, so pedantic lints are errors + # both locally and here. We want that — a toolchain bump that adds a + # new pedantic lint reds the build until the code is updated, rather + # than sliding in unnoticed. (The lint table allows a few noisy + # pedantic lints explicitly, e.g. `must_use_candidate`; those keep + # their allow via higher priority.) clippy = craneLib.cargoClippy { src = cleanSrc; inherit cargoArtifacts nativeBuildInputs;