Skip to content

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

Merged
tupe12334 merged 2 commits into
mainfrom
clippy/allow-attributes-without-reason
Jul 27, 2026
Merged

chore(lint): enable clippy::allow_attributes_without_reason#94
tupe12334 merged 2 commits 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

tupe12334 and others added 2 commits June 26, 2026 21:46
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>
…es-without-reason

# Conflicts:
#	Cargo.toml
#	tests/snapshot_tests.rs
@tupe12334

Copy link
Copy Markdown
Member Author

Resolved merge conflict against main via manual-merge-both-kept. Cargo.toml had independent sibling-lint additions (panic, expect_used, panic_in_result_fn) kept alongside this PR's allow_attributes_without_reason. tests/snapshot_tests.rs had an overlapping edit on the crate-level #![allow(missing_docs)] attribute plus a sibling's new #![allow(clippy::expect_used)]; kept both allows and added a reason = ... to the sibling's attribute too, so the file complies with the very lint this PR turns on.

Posted by the moadim routine "Resolve conflicts on code-quality PRs (non-guiddeco)".

@tupe12334
tupe12334 merged commit 93645f9 into main Jul 27, 2026
1 check passed
@tupe12334
tupe12334 deleted the clippy/allow-attributes-without-reason branch July 27, 2026 09:11
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