You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
However putting that into lib.rs results in a clippy warning:
lint name clippy is deprecated and may not have an effect in the future. Also cfg_attr(cargo-clippy) won't be necessary anymore
note: #[warn(renamed_and_removed_lints)] on by default
help: change it to: clippy::all
...which confused me as it says cfg_attrwon't be necessary -- maybe it's necessary now? Googling that found #149 which didn't make things clearer...
I think the right way to opt-in is adding #![warn(clippy::all)] to all the crate roots, i.e. main.rs, lib.rs, any examples/*.rs, and integration tests/*.rs. And making it conditional as in #![cfg_attr(feature = "cargo-clippy", warn(clippy::all))] is not necessary now, as current stable/beta/nightly will not fail building the project without the conditional. Is that right?
One more thing to clarify is whether clippy::all is the only variant that works as an opt-in for RLS or other categories would work too.
The text was updated successfully, but these errors were encountered:
Yep I agree the readme should be updated to #![warn(clippy::all)]. Would you like to raise a pr?
opt-in means clippy will run but with everything "allowed" so you have to opt into any clippy warnings. Other than that it should be exactly the same as running clippy any other way, so you can get clippy to show more warnings, ie #![warn(clippy::all, clippy::clone_on_ref_ptr)], opt out of warnings #![allow(clippy::cast_lossless)] etc.
Setting clippy_preference = "on" means clippy will run as default, equivalent to having #![warn(clippy::all)] in every target, ie the default warnings when you run cargo clippy.
Uh oh!
There was an error while loading. Please reload this page.
The README says:
(the same text was copied to the VS Code extension in rust-lang/vscode-rust#417 )
However putting that into
lib.rs
results in a clippy warning:...which confused me as it says
cfg_attr
won't be necessary -- maybe it's necessary now? Googling that found #149 which didn't make things clearer...I think the right way to opt-in is adding
#![warn(clippy::all)]
to all the crate roots, i.e.main.rs
,lib.rs
, anyexamples/*.rs
, and integrationtests/*.rs
. And making it conditional as in#![cfg_attr(feature = "cargo-clippy", warn(clippy::all))]
is not necessary now, as current stable/beta/nightly will not fail building the project without the conditional. Is that right?One more thing to clarify is whether
clippy::all
is the only variant that works as an opt-in for RLS or other categories would work too.The text was updated successfully, but these errors were encountered: