chore(lint): enable clippy::allow_attributes_without_reason#94
Open
tupe12334 wants to merge 1 commit into
Open
chore(lint): enable clippy::allow_attributes_without_reason#94tupe12334 wants to merge 1 commit into
tupe12334 wants to merge 1 commit into
Conversation
Every #[allow(...)] suppression now requires a reason = "..." string
explaining why the lint is suppressed. Without a reason, a suppression
is opaque: a future reader cannot tell whether it is a deliberate policy
decision, a temporary workaround, or an accidental copy-paste. Documenting
the reason turns each suppression into self-explanatory code and makes it
easy to re-evaluate or remove them as the codebase evolves.
Eight existing allow attributes have been annotated:
- main.rs: missing_docs — binary crate, docs live in the lib
- tests/cli.rs, tests/git.rs, tests/snapshot_tests.rs: missing_docs — test code
- opener/entries.rs: unused_mut — cfg-gated platform blocks mutate v
- opener/terminal.rs: literal_string_with_formatting_args — ${SHELL} is shell syntax
- scheme/macos/mod.rs: unnecessary_wraps — matches cross-platform abstraction
- commands/open/mod.rs: fn_params_excessive_bools — each bool is a distinct CLI flag
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
clippy::allow_attributes_without_reason = "deny"in[lints.clippy]#[allow]/#![allow]attributes withreason = \"...\"stringsCloses #93
What changed
Cargo.toml— adds the lint with an explanatory comment.8 attribute sites annotated (no logic changes):
src/main.rsmissing_docstests/cli.rsmissing_docstests/git.rsmissing_docstests/snapshot_tests.rsmissing_docssrc/opener/entries.rsunused_mutcfg-gated blocks mutatevon macOS/Linuxsrc/opener/terminal.rsliteral_string_with_formatting_args${SHELL}is POSIX shell syntax, not a Rust format argsrc/scheme/macos/mod.rsunnecessary_wrapsscheme::status()abstractionsrc/commands/open/mod.rsfn_params_excessive_boolsVerification