Skip to content

Lint #[level()] attribute without lint reason (#![feature(lint_reasons)]) #8502

Closed
@xFrednet

Description

@xFrednet

What it does

It checks for level attributes without a reason.

I think it would be good to have a config value that sets the minimum lint level of the #[level()] attribute. By default, it should only warn for allow end expect

I actually don't think that this actually requires a config value :)

Lint Name

allow_lint_without_reason

Category

restriction

Advantage

Enforces the user to reason about allowed lints

Drawbacks

Updating current code bases will take quite some work

Example

#![feature(lint_reasons)]

#![allow(clippy::some_lint)]

Could be written as:

#![feature(lint_reasons)]

#![allow(clippy::some_lint, reason = "False positive rust-lang/rust-clippy#1002020")]

@rustbot claim

Metadata

Metadata

Assignees

Labels

A-lintArea: New lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions