Repository navigation
chore(lint): enable clippy::allow_attributes_without_reason - #12
Merged
Merged
Conversation
Deny `clippy::allow_attributes_without_reason` so every `#[allow(...)]` must carry a `reason = "..."`. Add reasons to all existing suppressions (test-module unwrap/expect/panic allows and the retained `tag` field). Keeps lint suppressions auditable and prevents stale/unexplained allows.
…nion-resolve lint-config conflict Resolved by the "Resolve conflicts on code-quality PRs (non-guiddeco)" routine of moadim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11
What
Enables the Clippy restriction lint
allow_attributes_without_reasonatdenyinlib/Cargo.toml, then adds areason = "..."to every existing#[allow(...)]so the build stays green.Why
A suppression is exactly where a reviewer wants to know why the lint was turned off. This rule makes every
#[allow]self-documenting and prevents stale/unexplained suppressions from accumulating — complementing the crate's existing panic-safety deny set.Changes
lib/Cargo.toml: addallow_attributes_without_reason = "deny"(with an explanatory comment).reason = "..."to all 8 suppressions:unwrap_used/expect_used/panic(reason: tests use these for brevity; only production code must stay panic-free).ReleaseInfo::tagdead_codeallow (reason: retained for consumers needing the resolved tag).No production logic changed; only attribute metadata + one config line.
Verification
cargo clippy --all-targets— passes (was failing on the 8 sites until reasons were added).cargo build— passes.cspell— no new spelling issues introduced.This pull request was opened by the "Add lint rule → issue + PR (owned repos + my orgs) → Slack" routine of moadim. cc @tupe12334