Skip to content
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

Configuring lint levels when using clippy-driver #6799

Closed
ojeda opened this issue Feb 26, 2021 · 2 comments
Closed

Configuring lint levels when using clippy-driver #6799

ojeda opened this issue Feb 26, 2021 · 2 comments
Labels
A-documentation Area: Adding or improving documentation A-ui Area: Clippy interface, usage and configuration

Comments

@ojeda
Copy link
Contributor

ojeda commented Feb 26, 2021

Now that Clippy describes a way to be used on its own (see #6782), it would be nice to have a way to customize the lints level outside of code.

That is, either having a way to pass the -A/-W/-D/-F flags (without __CLIPPY_HACKERY__), or picking them up from the configuration file (see #6798).

@camsteffen camsteffen added A-documentation Area: Adding or improving documentation A-ui Area: Clippy interface, usage and configuration labels Feb 26, 2021
@flip1995
Copy link
Member

flip1995 commented Jul 2, 2021

This should be possible already. Do you have an example where this doesn't work? I checked it locally and if worked as expected:

// main.rs
fn main() { let _ = 3.14; }
$ clippy-driver main.rs
error: approximate value of `f{32, 64}::consts::PI` found. Consider using it directly
 --> main.rs:2:13
  |
2 |     let _ = 3.14;
  |             ^^^^
  |
  = note: `#[deny(clippy::approx_constant)]` on by default
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant

error: aborting due to previous error

vs

$ clippy-driver main.rs -Aclippy::approx_constant
$ echo $?
0

@ojeda
Copy link
Contributor Author

ojeda commented Jul 2, 2021

Confirmed -- it works now. Not sure if something changed since February, or I was mistaken back then.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Adding or improving documentation A-ui Area: Clippy interface, usage and configuration
Projects
None yet
Development

No branches or pull requests

3 participants