Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint error when needlessly supressing a lint #4636

Closed
lopopolo opened this issue Oct 7, 2019 · 1 comment
Closed

Lint error when needlessly supressing a lint #4636

lopopolo opened this issue Oct 7, 2019 · 1 comment

Comments

@lopopolo
Copy link

lopopolo commented Oct 7, 2019

Rubocop (a Ruby linter) can suppress lints via a magic comment in a similar way that you can #[allow(clippy::...)]. Rubocop also has a lint that triggers if one of these comments appears and is not suppressing a lint error.

One common thing I've run into is to have many #[allow(clippy::module_name_repetitions)] and then rename the module in a refactoring, which makes these properties not required and they will remain as noise.

Is such a lint feasible?

@flip1995
Copy link
Member

flip1995 commented Oct 7, 2019

Sadly this can hardly be done in Clippy and needs to be implemented in rustc.

Is such a lint feasible?

But yes, of course this is very feasible! There even is an RFC about this feature. Also see the tracking issue: rust-lang/rust#54503.

TL;DR: The plan is to introduce an expect attribute into the compiler, that does just that.

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

No branches or pull requests

2 participants