rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.98k stars 1.55k forks source link

Rust analyzer does not respects project-level clippy directives? #16419

Closed acidnik closed 5 months ago

acidnik commented 6 months ago

I have a line in my main.rs: #![allow(clippy::redundant_field_names)] This way, when I run cargo clippy I don't see warnings about redundant field names

But RA shows me the notice anyway, both in neovim and vs code

Is this a bug or a feature? Is there a way to disable some clippy rules for whole project so that RA respects that?

alibektas commented 5 months ago

:wave: Could you share more context? Maybe a repro if you can?

alibektas commented 5 months ago

I believe that the person reported this issue has mistakenly taken a rust-analyzer native lint for one of clippy's own lints, as we also have a redundant_field_name. As such there is nothing wrong with our flycheck. The user may disable native diagnostics by declaring rust-analyzer.diagnostics.disabled.

Is there a way to disable some clippy rules for whole project so that RA respects that?

You will the configuration sub-keys under the key rust-analyzer.check