Skip to content

chore(lint): enable clippy::allow_attributes_without_reason#94

Open
tupe12334 wants to merge 1 commit into
mainfrom
clippy/allow-attributes-without-reason
Open

chore(lint): enable clippy::allow_attributes_without_reason#94
tupe12334 wants to merge 1 commit into
mainfrom
clippy/allow-attributes-without-reason

Conversation

@tupe12334

Copy link
Copy Markdown
Member

Summary

  • Enables clippy::allow_attributes_without_reason = "deny" in [lints.clippy]
  • Annotates the 8 existing #[allow] / #![allow] attributes with reason = \"...\" strings

Closes #93

What changed

Cargo.toml — adds the lint with an explanatory comment.

8 attribute sites annotated (no logic changes):

File Lint suppressed Reason added
src/main.rs missing_docs binary crate, docs live in the lib
tests/cli.rs missing_docs integration test, no docs needed
tests/git.rs missing_docs integration test, no docs needed
tests/snapshot_tests.rs missing_docs integration test, no docs needed
src/opener/entries.rs unused_mut cfg-gated blocks mutate v on macOS/Linux
src/opener/terminal.rs literal_string_with_formatting_args ${SHELL} is POSIX shell syntax, not a Rust format arg
src/scheme/macos/mod.rs unnecessary_wraps matches cross-platform scheme::status() abstraction
src/commands/open/mod.rs fn_params_excessive_bools each bool is a distinct CLI flag

Verification

cargo clippy --all-targets   # ✓ no warnings or errors
cargo test                   # ✓ 6 passed, 0 failed

This pull request was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim.
@tupe12334

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable clippy::allow_attributes_without_reason lint

1 participant