-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
-A should override -W when it appears later on the command line #4091
Comments
Does this work with rustc lints? E.g: cargo check -- -D warnings -A unused // main.rs
fn main() {
let x = 42;
} Otherwise this would be a rustc issue, since the flags are handled by rustc and just forwarded to Clippy. |
I have same problem. Command::new("cargo")
.args(&[
"clippy",
"--all",
"--tests",
"--",
"-Dclippy::all",
"-Aclippy::new-without-default",
"-Dwarnings",
]) does not prevent Clippy from giving me error:
|
A workaround is to use annotations, where a specific #![deny(clippy::pedantic)]
#![allow(clippy::enum_glob_use)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When more than one -A, -D, or -W option in a clippy invocation refers to the same lint, either directly or indirectly, whichever one came last on the command line should win. The most important reason for this is so you can enable a category of warnings that's off by default, but then turn some of them back off again. For example, suppose
src/demo.rs
is this:then this invocation should not complain about the non-ASCII characters in the string literal, but currently it does:
One might also want to be able to do
-D warnings -A clippy::something_specific
or-W clippy::all -D clippy::particular_bad_thing
.Version information:
The text was updated successfully, but these errors were encountered: