-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make clippy a git subtree instead of a git submodule #70655
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
Conversation
Whoa, clippy commit hashes were kept intact, this makes me really happy!11 |
r? @Mark-Simulacrum for the |
bootstrap changes look good (presuming they work, though the mingw-check job should confirm that clippy check works -- and it seems to have passed). |
Does this also enable running (at least UI) tests for Clippy on every PR? |
This comment has been minimized.
This comment has been minimized.
yes. We already run these right now on every PR, but we used to ignore it if clippy failed to successfully run its tests. |
☔ The latest upstream changes (presumably #70809) made this pull request unmergeable. Please resolve the merge conflicts. |
Rollup of 11 pull requests Successful merges: - rust-lang#5406 (Fix update_lints) - rust-lang#5409 (Downgrade let_unit_value to pedantic) - rust-lang#5410 (Downgrade trivially_copy_pass_by_ref to pedantic) - rust-lang#5412 (Downgrade inefficient_to_string to pedantic) - rust-lang#5415 (Add new lint for `Result<T, E>.map_or(None, Some(T))`) - rust-lang#5417 (Update doc links and mentioned names in docs) - rust-lang#5419 (Downgrade unreadable_literal to pedantic) - rust-lang#5420 (Downgrade new_ret_no_self to pedantic) - rust-lang#5422 (CONTRIBUTING.md: fix broken triage link) - rust-lang#5424 (Incorrect suspicious_op_assign_impl) - rust-lang#5425 (Ehance opt_as_ref_deref lint.) Failed merges: - rust-lang#5345 (Add lint for float in array comparison) - rust-lang#5411 (Downgrade implicit_hasher to pedantic) - rust-lang#5428 (Move cognitive_complexity to nursery) r? @ghost changelog: rollup
When checking for functions that are potential candidates for trait implementations check the function header to make sure modifiers like asyncness, constness and safety match before triggering the lint. Fixes rust-lang#5413, rust-lang#4290
Move cognitive_complexity to nursery As discussed in rust-lang/rust-clippy#5418 (comment); Clippy's current understanding of cognitive complexity is not good enough yet at analyzing code for understandability to have this lint be enabled by default. changelog: Remove cognitive_complexity from default set of enabled lints
Check fn header along with decl when suggesting to implement trait When checking for functions that are potential candidates for trait implementations check the function header to make sure modifiers like asyncness, constness and safety match before triggering the lint. Fixes rust-lang#5413, rust-lang#4290 changelog: check fn header along with decl for should_implement_trait
Downgrade implicit_hasher to pedantic From the [documentation](https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher), this lint is intended to suggest: ```diff - pub fn foo(map: &mut HashMap<i32, i32>) { } + pub fn foo<S: BuildHasher>(map: &mut HashMap<i32, i32, S>) { } ``` I think this is pedantic. I get that this lint can benefit core libraries like serde, but that's exactly the use case for pedantic lints; a library like serde will [enable clippy_pedantic](https://github.com/serde-rs/json/blob/fd6741f4b0b3fc90a58a6f578e33a9adc6403f3f/src/lib.rs#L304) and take the time to go through everything possible. Similar for libraries doing a libz blitz style checkup before committing to a 1.0 release; it would make sense to run through all the available pedantic lints then. But otherwise, for most codebases and certainly for industrial codebases, the above suggested change just makes the codebase more obtuse for questionable benefit. changelog: Remove implicit_hasher from default set of enabled lints
📌 Commit bce9fae has been approved by |
Yep, I reviewed those three manually. |
Thanks for the quick work! I'm very excited to be trying this out for clippy. |
☀️ Test successful - checks-azure |
📣 Toolstate changed by #70655! Tested on commit 53d3bc0. 💔 clippy-driver on windows: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq). |
Tested on commit rust-lang/rust@53d3bc0. Direct link to PR: <rust-lang/rust#70655> 💔 clippy-driver on windows: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq). 💔 clippy-driver on linux: test-pass → test-fail (cc @mcarton @oli-obk @Manishearth @flip1995 @yaahc @phansch @llogiq).
CI logs show, that all Clippy tests passed.
|
Yeah not sure what's up with that. We'll want to remove clippy from toolstate at least for sure since it should always be test-pass now (I suspect the above might be spurious? we're no longer recording clippy toolstate I think as of this PR) |
So is this also gating on subtree clippy? (Not sure if we were doing that in two steps) @oli-obk do we have a set of instructions for what we should do about syncs? |
Instructions were added in #70654 |
If I understand the changes correctly, Clippy now gets checked like rustdoc. So yes, this also gates at subtree clippy. |
Should we have a copy of that inside the clippy repo as well? |
We should change the documentation in clippy that talks about updating clippy in rust-lang/rust (I think that exists?) |
The reason toolstate fails is that we now don't report any toolstate for clippy anymore, and thus toolstate assumes "failure". I completely forgot about that part of toolstate, I'll look into it tomorrow |
if try_run(builder, &mut cargo.into()) { | ||
builder.save_toolstate("clippy-driver", ToolState::TestPass); | ||
} |
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.
This porbably caused rust-highfive to think that clippy is test-fail now.
This will break rebase on master for all people in the near future:
The solution is to get rid of the clippy submodule before the rebase:
|
r? @eddyb
cc #70651
documentation at #70654