作者:婷婷爱BB | 来源:互联网 | 2023-09-06 17:50
Hello.
I'm working on a project that has several smaller Rust projects and wanted to add every possible lint or lint group to them so we know exactly what's still there to fix and know exactly when something bad is introduced. I should note that these smaller projects are not in a workspace.
Using the typical
for a group and then
another lint inside it is what I wanted to do initially, but also having rustc lints in that list quickly bloated it to about 45 lines. And managing this list in every small project is pain. So I ended up writing a small script that can be run from inside the CI and by developers alike without having to manually update all
or
files every time a new lint can be
'd.
When running the script it turned out that all of the lints in groups that were on
suddenly popped up again even though they were
ed.
For example:
1
| cargo clippy -- --deny clippy::pedantic --allow clippy::similar_names |
still triggers the
lint. Using
1 2 3
| rust
#![deny(clippy::pedantic)]
#![allow(clippy::similar_names)] |
works flawlessly.
This was tested with
1
| clippy 0.0.212 (b2601be 2018-11-27) |
and pretty much forces me to fill 4 lib.rs/main.rs files with about 45
and
-s.
Is there a reason a
flag does not overwrite a
flag? If so, why?
该提问来源于开源项目:rust-lang/rust-clippy
Thank you for taking the time to respond. I'll close this issue.