Skip to content

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

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

Closed
acidnik opened this issue Jan 23, 2024 · 2 comments
Closed

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

acidnik opened this issue Jan 23, 2024 · 2 comments
Assignees
Labels
C-support Category: support questions

Comments

@acidnik
Copy link

acidnik commented Jan 23, 2024

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?

@acidnik acidnik added the C-support Category: support questions label Jan 23, 2024
@alibektas alibektas self-assigned this Feb 26, 2024
@alibektas
Copy link
Member

👋 Could you share more context? Maybe a repro if you can?

@alibektas
Copy link
Member

alibektas commented Mar 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

2 participants