-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Lint #[cfg_attr(rustfmt, rustfmt_skip)] and suggest #[rustfmt::skip] #3123
Conversation
If I understand it correctly, this would also produce the same warnings as in #3159, right? Should we wait until tool_lints are stable to merge this? |
No this is a |
7842bbc
to
ccfa5f6
Compare
Ok, I looked into this a little more:
830 let (mut krate, features) = syntax::config::features(
831 krate,
832 &sess.parse_sess,
833 sess.edition(),
834 ); while PreExpansionPass lints are executed here: 942 time(sess, "pre ast expansion lint checks", || {
943 lint::check_ast_crate(sess, &krate, true)
944 }); The reason only inner/crate attributes are effected by this, is that the compiler only looks at Crate-level attributes and not on Item-level attributes in the |
ccfa5f6
to
72852fa
Compare
Since having |
|
72852fa
to
70995c6
Compare
0a831eb
to
e185da7
Compare
`tool_attributes` are stable since 1.30. The old `cfg_attr(rustfmt, rustfmt_skip)` attributes aren't necessary anymore and everyone should switch to `#[rustfmt::skip]` sooner or later. There is also a Clippy lint in the making for this: rust-lang/rust-clippy#3123
|
I added a few tests from I just realized, that we don't have a check for the copyright statement in test and clippy source files. We should add such a check (for easier reviews). Since it is hard to write lints for comments, we should probably add this check in |
bors try |
tryBuild failed |
d1538cc
to
edc8706
Compare
edc8706
to
318f84f
Compare
LGTM! bors r+ |
3123: Lint #[cfg_attr(rustfmt, rustfmt_skip)] and suggest #[rustfmt::skip] r=phansch a=flip1995 Closes #3121 Co-authored-by: flip1995 <[email protected]> Co-authored-by: flip1995 <[email protected]>
Closes #3121