Roll out the strict clippy lint set to every crate
Roll out the strict Clippy lint set currently enabled on five crates to the entire workspace incrementally: existing code continues to pass, new code is checked against the full lint set immediately, and existing violations are burned down over time.
Current State
[workspace.lints.clippy]enablesallandpedanticwith twelve allowed lints. Every workspace crate inherits this configuration exceptcrates/contrib/xct2cli, which maintains its own lint list to stay close to upstream.- Five crates (
jp_config,jp_conversation,jp_md,jp_printer, andjp_pty) add a#![warn(…)]block inlib.rsenablingclippy::nursery,missing_docs,rustdoc::all, and restriction lints such asunwrap_used,allow_attributes,missing_docs_in_private_items,todo,unimplemented, anduse_debug. just lint-ciruns Clippy with--deny warnings, so enabling a lint workspace-wide requires fixing every existing violation in the same commit.
Problem: No Incremental Rollout
rustqual had the same adoption barrier, which qual solved by diffing findings against the base revision (T-0yh5npc). Three approaches can provide incremental rollout for Clippy:
- Diff gate. Run non-clean lints in a second Clippy pass without
--deny warnings, and compare its diagnostics against the base revision by(lint, file, symbol)asqual diffdoes forrustqual. New code is checked against every lint immediately without adding suppression attributes to the codebase, and CI,cargo_check, guidance files, and the burn-down mission (T-0yh5sy9) work the same way as they do forrustqual. Once a lint reaches zero violations, it moves into[workspace.lints], which serves the same role as theenforcedlist inqual.toml. Cost: requires a second Clippy pass over bothbaseandhead, plus a Clippy JSON diagnostic parser inqual(which T-1dhk659 otherwise plans to fold intorustqualand delete). - Per-site
#[expect]attributes. Enable the lints in[workspace.lints]and use Clippy's JSON output to insert#[expect(clippy::..., reason = "...")]on every existing violation. New code is checked immediately, andrustcwarns when an#[expect]attribute becomes stale after a fix. Cost: adds thousands of attributes for high-volume lints, and cannot suppress module-wide lints such asmissing_docs_in_private_itemsat individual sites. - Crate-level
#![allow]lists. Move the strict lint set into[workspace.lints]and add a crate-level#![allow(…)]inlib.rsfor each crate that still has violations. Cost: requires no extra tooling, but new code in crates that still allow a lint is not checked, allowing violations to accumulate during the burn-down.
To settle in the RFD
- Which rollout mechanism (or combination) to use.
- The target lint set: the existing five-crate block, all of
clippy::restrictionminus an allowlist, or a curated subset. - Whether
crates/contrib/*crates that track an upstream repository are in scope. - How to structure the burn-down mission (for example, one run per lint as T-0yh5sy9 does per
rustqualrule, and whether both share a mission script). - How to sequence this rollout with the
rustqualburn-down, since T-1haa4rr migrates fiverustqualrules to Clippy lints and running both would touch the same call sites twice.