Different set of lints for tests? #11343
Unanswered
nbigaouette
asked this question in
Q&A
Replies: 1 comment
-
If you run In general it is probably best to define lints in the crate as inner attributes, instead of the command line. Then everyone working on the crate has the same set of lints enabled, and it doesn't depend on their r-a config. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I enable a lot of lints for my code, for example I use
-Wclippy::pedantic -Dclippy::unwrap_used
for clippy settings in VSCode'ssettings.json
'srust-analyzer.check.extraArgs
.This way I can stay in my editor and get aggressive feedback for things that are enforced in CI.
The issue I have is that those lints are too aggressive for tests; I'm fine with unwrapping in unit test for example.
Is there a way to have two sets of lints (at the command line), one for the main code and the other for
#[cfg(test)]
?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions