-
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
Add new lint DEPRECATED_CLIPPY_CFG_ATTR
#12292
Add new lint DEPRECATED_CLIPPY_CFG_ATTR
#12292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impl LGTM. 2 open questions.
I think we want to wait with merging this, until cfg(clippy)
is known by rustc/cargo? Then we'll also add --cfg clippy
to the clippy-driver
.
We can do it at the same time. It won't be an issue until clippy is synced in rust-lang/rust. |
7f1e19f
to
22cd0dd
Compare
22cd0dd
to
51dc344
Compare
Finally fixed doc test and dogfood. ^^' |
That's in exactly one week. Will rustc be ready until then. I'd rather approve the PR and leave it as |
Sending the PR for rust in a few minutes. |
Opened rust-lang/rust#121137. |
51dc344
to
f4a3db8
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and approved.
The last open question is, if this should be an extra lint or if it should be merged into DEPRECATED_CFG_ARG
?
"replace with", | ||
"clippy".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible enhancement to this lint could be to check if the second part of the cfg_attr
is an allow
/warn
/... and suggest to remove the cfg_attr
completely.
OTOH we might want to add an extra lint for this, once people moved to cfg_attr(clippy, allow(...))
.
So I wouldn't do this in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the same suggestion to @GuillaumeGomez in private and we also thought that it would be better done in a follow-up, as to also catch the pattern with cfg_attr(clippy, ...)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm we did. ;)
I'll likely send a follow-up PR.
I would propose to keep |
No problem, I have not yet proposed stabilization of the feature. We are currently running a Call for Testing, we may run it for a second week, after that and if all goes well, I will propose stabilization in |
@@ -271,7 +271,9 @@ pub fn main() { | |||
}, | |||
_ => Some(s.to_string()), | |||
}) | |||
// FIXME: remove this line in 1.79 to only keep `--cfg clippy`. | |||
.chain(vec!["--cfg".into(), r#"feature="cargo-clippy""#.into()]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Urgau Can I ask you to remove this line as part of the stabilization PR of the -Zcheck-cfg
feature in rust-lang/rust
please? That way, the time people have to transition is as long as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem.
Answering my final question myself: After thinking about this, I prefer to use a new lint for this, because:
With that and as the @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Thank you @flip1995 (and @GuillaumeGomez) for your help, I really appreciate it ❤️. Without your help this issue could very well have delayed check-cfg or even put it in limbo. Thank you very much. |
It allows me to take a break from some compiler stuff so it's very welcome. 😄 |
rust-lang/blog.rust-lang.org#1253 I thought I'd write a blog post about this. |
…rgau,Nilstrieb Add clippy into the known `cfg` list In clippy, we are removing the `feature = "cargo-clippy"` cfg to replace it with `clippy` in rust-lang/rust-clippy#12292. But for it to work, we need to declare `clippy` as cfg. It makes it more coherent with other existing tools like rustdoc. cc `@flip1995`
Rollup merge of rust-lang#121137 - GuillaumeGomez:add-clippy-cfg, r=Urgau,Nilstrieb Add clippy into the known `cfg` list In clippy, we are removing the `feature = "cargo-clippy"` cfg to replace it with `clippy` in rust-lang/rust-clippy#12292. But for it to work, we need to declare `clippy` as cfg. It makes it more coherent with other existing tools like rustdoc. cc `@flip1995`
…ip1995 Add `unnecessary_clippy_cfg` lint Follow-up of #12292. r? `@flip1995` changelog: Add `unnecessary_clippy_cfg` lint
`cfg(feature = "cargo-clippy")` has been [deprecated]. The correct way to achieve the same result is now `cfg(clippy)`. [deprecated]: rust-lang/rust-clippy#12292
`cfg(feature = "cargo-clippy")` has been [deprecated]. The correct way to achieve the same result is now `cfg(clippy)`. [deprecated]: rust-lang/rust-clippy#12292
…flip1995 Remove `feature=cargo-clippy` argument Roses are red, Violets are blue, Fixme was written, And now it's due --- changelog: **Important Change** Removed the implicit `cargo-clippy` feature set by Clippy as announced here: <https://blog.rust-lang.org/2024/02/28/Clippy-deprecating-feature-cargo-clippy.html> [#13246](#13246) Follow-up of: #12292 r? `@flip1995` cc: `@GuillaumeGomez`
As discussed on zulip.
This lint suggests to replace
feature = "cargo-clippy"
withclippy
.r? @flip1995
changelog: Add new lint
DEPRECATED_CLIPPY_CFG_ATTR