Skip to content

Enable clippy::allow_attributes_without_reason lint #93

Description

@tupe12334

What this lint catches

clippy::allow_attributes_without_reason flags every #[allow(...)] or #![allow(...)] attribute that does not carry a reason = \"...\" string.

Without a reason, a lint suppression is opaque. A future reader cannot tell:

  • whether the suppression is a deliberate, long-lived policy decision
  • whether it is a temporary workaround waiting to be removed
  • or whether it is an accidental copy-paste that no longer applies

Why it improves code quality

Requiring a reason turns each suppression into self-documenting code:

// Before — opaque
#[allow(clippy::fn_params_excessive_bools)]

// After — explains the tradeoff
#[allow(clippy::fn_params_excessive_bools, reason = \"each bool maps directly to a distinct CLI flag; wrapping them in a flags struct would add indirection without clarity gains at the single call site\")]

This makes it easy to audit suppressions over time ("is this reason still valid?") and to remove them safely when the underlying issue is fixed.

Scope

The codebase currently has 8 #[allow] / #![allow] attributes — all in small, well-understood locations — making this a low-risk, high-signal change.


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions