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

Use #![warn(clippy::all)] #1528

Merged
merged 1 commit into from
May 7, 2019
Merged

Use #![warn(clippy::all)] #1528

merged 1 commit into from
May 7, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Apr 16, 2019

All lints included in clippy::all are enabled by default when doing cargo clippy.
But we can only check this by actually running cargo clippy.

In some editors, using #![warn(clippy::all)] makes it possible to receive warnings as well as lints provided by the language (at least with the vscode I use).

We will be happy because we do not have to check each time in local.

@@ -8,6 +8,7 @@
#![cfg_attr(not(feature = "std"), no_std)]

#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![warn(clippy::all)]
Copy link
Member Author

@taiki-e taiki-e Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is separated from other lints (missing_docs, rust_2018_idioms, etc.) because the providers are different.

@Nemo157
Copy link
Member

Nemo157 commented Apr 16, 2019

How does this work with vscode? I would expect it to run either cargo check or cargo clippy against the codebase, the former will ignore this attribute since it's a tool-scoped lint, the latter would have included clippy lints already. Maybe it's using RLS and RLS has some kind of "this project uses clippy" detection based on the lint attribute and pulls in clippy automatically?

@Nemo157
Copy link
Member

Nemo157 commented Apr 16, 2019

Ah, yes, looks like RLS defaults to detecting clippy lint config unless you override the clippy_preference setting.

I dislike the fact that clippy::all actually means the default warning set, but otherwise I think this makes sense to add (until RLS allows a workspaced scoped configuration for this at least, having to add it to every single crate is annoying EDIT: opened rust-lang/rls#1432).

@taiki-e
Copy link
Member Author

taiki-e commented Apr 16, 2019

How does this work with vscode? I would expect it to run either cargo check or cargo clippy against the codebase, the former will ignore this attribute since it's a tool-scoped lint, the latter would have included clippy lints already. Maybe it's using RLS and RLS has some kind of "this project uses clippy" detection based on the lint attribute and pulls in clippy automatically?

Ah, as you say that's a feature of rls.

@taiki-e
Copy link
Member Author

taiki-e commented Apr 16, 2019

I dislike the fact that clippy::all actually means the default warning set,

Certainly "all" is a misleading name. Maybe clippy::default is a better name?

@Nemo157
Copy link
Member

Nemo157 commented Apr 16, 2019

Yeah clippy::default sounds better, but that's unlikely to change soon. I think merging this as-is to get it working now for RLS users is good (unfortunately I'm not one, maybe I should get round to looking at setting it up). I'd like @cramertj's feedback as well though.

@cramertj
Copy link
Member

I don't have a strong opinion-- I'm not an RLS user either. +1 that default would be much clearer than all.

@taiki-e
Copy link
Member Author

taiki-e commented Apr 18, 2019

(Hmm, default seems to have already been discussed in rust-lang/rust-clippy#2964 and rejected.)

@taiki-e taiki-e force-pushed the clippy-all branch 2 times, most recently from ebe8e86 to aa4df31 Compare April 25, 2019 03:36
@cramertj cramertj merged commit f4dad66 into rust-lang:master May 7, 2019
@taiki-e taiki-e deleted the clippy-all branch May 7, 2019 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants