-
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
[pathbuf_init_then_push
]: Checks for calls to push
immediately a…
#11700
Conversation
r? @Manishearth (rustbot has picked a reviewer for you, use r? to override) |
r? @Centri3 |
948e318
to
b08fd94
Compare
Someone may care about the performance: .join() introduce an implicit clone |
c7d7211
to
bb0c6a0
Compare
☔ The latest upstream changes (presumably #11791) made this pull request unmergeable. Please resolve the merge conflicts. |
Hey @lengyijun, would you mind rebasing this on master? @ARandomDev99 This might be a good PR to review. There are some conflicts, but the implementation should be unaffected by the rebase. If you comment something on this PR, I can also add you as an assignee r? xFrednet |
98cf1bd
to
7183542
Compare
I concur with Centri3. Instead of multiple calls to |
Could you explain why you feel this should be
|
565bac6
to
a72ad23
Compare
@lengyijun said:
This doesn't seem like a change that everyone would prefer. Having it allowed by default seems more appropriate to me. Unlike
I'm still relatively new around here. What does FCP mean? 😅 |
Ahh, yep you're right. Then
No problem, FCP stands for final comment period it's a new concept for Clippy. When a new lint is ready to be merged, we create a topic on zulip to get feedback. If no concerns are raised within ~1 week we merge the PR, otherwise we discuss the issues :) |
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.
The implementation looks good to me overall. I would like to see more tests, also negative examples of code that shouldn't trigger the lint. I left some example comments.
There is also a random binary file called c
. Can you remove that one?
If you rebase, we could also take a look at the lintcheck output in our CI :D
Sorry, that it took this long, it again slipped my mind 🙈
Let me know when this PR is ready to be reviewed again. I'm assuming the last commits are not ready yet due to their name :) |
☔ The latest upstream changes (presumably #12999) made this pull request unmergeable. Please resolve the merge conflicts. |
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 left some more comments, they should hopefully all be easy to fix. They are hopefully not too nitpicky ^^'
Let me know, if you have any question :D
598fcd1
to
c7e4ef4
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, I've started the FCP: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/FCP.3A.20.60pathbuf_init_then_push.60.20rust-clippy.2311700/near/449299039
I have one last tiny comment. Could you maybe also squash the smaller commits? Having one review commit or so is totally fine :D
☔ The latest upstream changes (presumably #13080) made this pull request unmergeable. Please resolve the merge conflicts. |
I assume the You can use span_contains_comment to check if there is a comment between the creation and the |
Okay, I'd say the FCP has concluded. It sounds like the lint is okay, but we had others suggest the |
0bd7839
to
53eb717
Compare
This version looks good to me, and the two detected cases in our CI are also very good: https://github.com/rust-lang/rust-clippy/actions/runs/10004116830?pr=11700 Thank you for the last changes. I left a tiny nit, which should be simple to fix. Then you can Roses are red, |
✌️ @lengyijun, you can now approve this pull request! If @xFrednet told you to " |
6d3a91e
to
4e849ef
Compare
…ter creating a new `PathBuf` Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: [
pathbuf_init_then_push
]: new lint: Checks for calls topush
immediately after creating a newPathBuf
Just a mirror of VEC_INIT_THEN_PUSH