Skip to content

Add governed Clippy policy baseline, MSRV→1.93, and xtask lint-policy check#261

Open
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/implement-standard-clippy-policy-for-rust-repos
Open

Add governed Clippy policy baseline, MSRV→1.93, and xtask lint-policy check#261
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/implement-standard-clippy-policy-for-rust-repos

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Motivation

  • Create a workspace-governed Clippy surface so linting is an engineering policy (machine-readable + enforced) rather than per-crate taste.
  • Ratchet the repo MSRV to 1.93 so planned Clippy flips can be tracked and staged predictably across the estate.
  • Provide structured, expiring exceptions (debt/allowlists) and an xtask gate so exceptions and test carveouts are visible and auditable.

Description

  • Bumped workspace MSRV to 1.93 and added a workspace-level lint baseline under [workspace.lints.rust] and [workspace.lints.clippy] in Cargo.toml to encode the panic-free, AST/string/index-safety, silent-failure, async/unsafe, numeric, and suppression-governance rules.
  • Added policy/ ledgers: policy/clippy-lints.toml (machine-readable active + planned lints + msrv), policy/clippy-debt.toml (debt ledger), policy/no-panic-allowlist.toml and policy/non-rust-allowlist.toml (structured allowlists), and docs/CLIPPY_POLICY.md documenting the policy and suppression style.
  • Implemented xtask gating: new xtask/src/lint_policy.rs plus a CheckLintPolicy subcommand wired into xtask/src/main.rs as cargo xtask check-lint-policy, which validates MSRV alignment, workspace inheritance ([lints] workspace = true), forbidden test-carveouts in clippy.toml, planned flips vs msrv, and debt entry shape.
  • Propagated [lints] workspace = true into crate manifests and adjusted clippy.toml and docs to align toolchain and MSRV; left unsafe_code staged as warn to acknowledge existing reviewed unsafe/FFI/RT lanes to be tracked as debt rather than immediately forbidding them.

Testing

  • Ran cargo +1.93.0 xtask check-lint-policy which succeeded and reported the new policy as coherent.
  • Ran cargo +1.93.0 check -p xtask which compiled the xtask checks successfully.
  • Ran rustfmt --check xtask/src/main.rs xtask/src/lint_policy.rs which passed.
  • cargo +1.93.0 fmt --all -- --check failed due to existing workspace-wide formatting diffs (pre-existing, unrelated to the xtask and policy files).
  • cargo +1.93.0 clippy -p xtask -- -D warnings surfaced existing repository debt (crate-level #[allow] usage, missing # Errors docs, arithmetic/indexing/string-slicing lints, and other items) and therefore failed; these are expected and must be addressed in follow-up cleanup/staged PRs.

Codex Task

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 17 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d76e6201-0522-4363-adb0-525afaeea29f

📥 Commits

Reviewing files that changed from the base of the PR and between 607f501 and c7697bc.

📒 Files selected for processing (121)
  • AGENTS.md
  • CLAUDE.md
  • Cargo.toml
  • README.md
  • ROADMAP.md
  • clippy.toml
  • crates/flight-ac7-input/Cargo.toml
  • crates/flight-ac7-protocol/Cargo.toml
  • crates/flight-ac7-telemetry/Cargo.toml
  • crates/flight-adapter-common/Cargo.toml
  • crates/flight-aerofly/Cargo.toml
  • crates/flight-axis/Cargo.toml
  • crates/flight-bdd-metrics/Cargo.toml
  • crates/flight-blackbox/Cargo.toml
  • crates/flight-bus/Cargo.toml
  • crates/flight-cli/Cargo.toml
  • crates/flight-cloud-profiles/Cargo.toml
  • crates/flight-core/Cargo.toml
  • crates/flight-dcs-bios/Cargo.toml
  • crates/flight-dcs-export/Cargo.toml
  • crates/flight-dcs-modules/Cargo.toml
  • crates/flight-device-common/Cargo.toml
  • crates/flight-elite/Cargo.toml
  • crates/flight-falcon-bms/Cargo.toml
  • crates/flight-ffb-brunner/Cargo.toml
  • crates/flight-ffb-moza/Cargo.toml
  • crates/flight-ffb-vpforce/Cargo.toml
  • crates/flight-ffb/Cargo.toml
  • crates/flight-headless/Cargo.toml
  • crates/flight-hid-support/Cargo.toml
  • crates/flight-hid-types/Cargo.toml
  • crates/flight-hid/Cargo.toml
  • crates/flight-hotas-brunner/Cargo.toml
  • crates/flight-hotas-ch/Cargo.toml
  • crates/flight-hotas-honeycomb/Cargo.toml
  • crates/flight-hotas-logitech-wheel/Cargo.toml
  • crates/flight-hotas-logitech/Cargo.toml
  • crates/flight-hotas-microsoft/Cargo.toml
  • crates/flight-hotas-saitek/Cargo.toml
  • crates/flight-hotas-simucube/Cargo.toml
  • crates/flight-hotas-sony/Cargo.toml
  • crates/flight-hotas-thrustmaster/Cargo.toml
  • crates/flight-hotas-turtlebeach/Cargo.toml
  • crates/flight-hotas-virpil/Cargo.toml
  • crates/flight-hotas-vkb/Cargo.toml
  • crates/flight-hotas-vpforce/Cargo.toml
  • crates/flight-hotas-winwing/Cargo.toml
  • crates/flight-il2/Cargo.toml
  • crates/flight-installer-tests/Cargo.toml
  • crates/flight-integration-tests/Cargo.toml
  • crates/flight-ipc/Cargo.toml
  • crates/flight-ksp/Cargo.toml
  • crates/flight-macos-hid/Cargo.toml
  • crates/flight-metrics-http/Cargo.toml
  • crates/flight-metrics/Cargo.toml
  • crates/flight-motion/Cargo.toml
  • crates/flight-open-hardware/Cargo.toml
  • crates/flight-opentrack/Cargo.toml
  • crates/flight-openxr/Cargo.toml
  • crates/flight-panels-core/Cargo.toml
  • crates/flight-panels-cougar/Cargo.toml
  • crates/flight-panels-goflight/Cargo.toml
  • crates/flight-panels-saitek/Cargo.toml
  • crates/flight-panels/Cargo.toml
  • crates/flight-pedals/Cargo.toml
  • crates/flight-plugin/Cargo.toml
  • crates/flight-prepar3d/Cargo.toml
  • crates/flight-process-detection/Cargo.toml
  • crates/flight-profile/Cargo.toml
  • crates/flight-psx/Cargo.toml
  • crates/flight-replay/Cargo.toml
  • crates/flight-rules/Cargo.toml
  • crates/flight-scheduler/Cargo.toml
  • crates/flight-security/Cargo.toml
  • crates/flight-service/Cargo.toml
  • crates/flight-session/Cargo.toml
  • crates/flight-sim-racing/Cargo.toml
  • crates/flight-simconnect-sys/Cargo.toml
  • crates/flight-simconnect/Cargo.toml
  • crates/flight-streamdeck/Cargo.toml
  • crates/flight-tactile/Cargo.toml
  • crates/flight-test-helpers/Cargo.toml
  • crates/flight-testkit/Cargo.toml
  • crates/flight-tracing/Cargo.toml
  • crates/flight-trackir/Cargo.toml
  • crates/flight-ui/Cargo.toml
  • crates/flight-units/Cargo.toml
  • crates/flight-updater/Cargo.toml
  • crates/flight-virtual/Cargo.toml
  • crates/flight-vr-overlay/Cargo.toml
  • crates/flight-vr/Cargo.toml
  • crates/flight-warthunder/Cargo.toml
  • crates/flight-watchdog/Cargo.toml
  • crates/flight-wingman/Cargo.toml
  • crates/flight-workspace-meta/Cargo.toml
  • crates/flight-writers/Cargo.toml
  • crates/flight-xplane-plugin/Cargo.toml
  • crates/flight-xplane/Cargo.toml
  • dashboard-config.toml
  • docs/CLIPPY_POLICY.md
  • docs/explanation/regression-prevention.md
  • docs/feature_status.md
  • docs/how-to/getting-started.md
  • docs/how-to/setup-dev-env.md
  • docs/implementation_history/TOOLCHAIN_ALIGNMENT_SUMMARY.md
  • docs/reference/ci-checks.md
  • docs/reference/clippy-rules.md
  • docs/reference/feature-status.md
  • docs/tutorials/getting-started.md
  • examples/Cargo.toml
  • infra/ci/README.md
  • infra/local/README.md
  • installer/Cargo.toml
  • policy/clippy-debt.toml
  • policy/clippy-lints.toml
  • policy/no-panic-allowlist.toml
  • policy/non-rust-allowlist.toml
  • specs/Cargo.toml
  • xtask/Cargo.toml
  • xtask/src/lint_policy.rs
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/implement-standard-clippy-policy-for-rust-repos

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member Author

Not auto-merging in this PR review pass — this is a substantial policy change that should land deliberately:

  1. MSRV bump 1.92.0 → 1.93 touches CLAUDE.md's stated MSRV 1.92.0 constraint and rust-toolchain.toml consumers. Worth a separate decision.
  2. Workspace-wide lint baseline + new [lints] blocks in 121 crate manifests is the kind of change that's safer to land in two PRs: the policy/governance scaffolding first (this PR's policy/*.toml, docs/CLIPPY_POLICY.md, xtask check-lint-policy), then a follow-up that flips [lints] workspace = true once the existing debt is cleared.
  3. Known failing cargo +1.93.0 clippy -p xtask -- -D warnings — your own PR description flags this as expected debt to address in follow-ups. Merging in that state would put main in a state where the new gate fails, which defeats the purpose of the gate.

Recommend: split into a "scaffold only" PR (policy ledgers + xtask check + docs, with [lints] workspace = false everywhere) that can land cleanly, and follow-up flips per-crate.

Also see #262 which appears to be a near-duplicate of the policy scaffolding part of this PR — pick one.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant