-
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
introduce rc_clone_in_vec_init lint #8769
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. |
Hey there whoever is going to review this 👋🏻 This is my first contribution to this (amazing) project I'm not sure my lint's name is the best - if you have a better name please lmk! Thanks ahead 🙂 |
Sorry for the single comments, forgot to start a review 😄 |
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.
Couple more things and it should be good 🙂
just saw that the commit message is |
Not a big deal, you can |
Just force-pushed again |
I'd say so, just have to see if @xFrednet has any other thoughts 🙂 |
😅 Wasn't even thinking, could you also check for |
lol that makes sense, sure thing. Will get to it soon enough |
@Serial-ATA regarding the name, i was thinking |
well i took the liberty to rename - lmk if you're ok with that 😄 |
Ah naming, the hardest part 😄. How about |
Uh, but |
Maybe |
Yeah, I think that's better. |
@Serial-ATA renamed 😃 |
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.
Just some typos in the file names, but otherwise LGTM. Thanks for addressing my comments so quickly 🙂.
Hey, thank you very much for the update! I'll have a look at it over the week. I've also answered you on Zulip 🙃
We have a similar tool for that ( CC: @Jarcho (In case you're interested 🙃 ) |
If I'll find some free time in the next few days I'll try to go for the suggestion implementation, but this pr should be ready to merge regardless, right? 🙂 |
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 version looks good to me, the suggestion update can be done in a followup PR as you suggested. I've also used lintcheck, and it found no lint trigger -> not false positive, which is nice. It would be awesome if you could squash the commits, as you offered 🙃
The last thing, I'm unsure about is the lint group. I agree that this is suspicious, but on the other hand, it's not really wrong to use it. Having it warn-by-default might be a bit too strict. @rust-lang/clippy, @Alexendoo, @dswij what are your thought on the group, should this be suspicious or pedantic? 🙃
I think Worst case is we change the category afterwards if it's too strict. |
@xFrednet I squashed, please take one last look to make sure i didn't f**k up anything while squashing, and lets merge it 🙂 |
Don't have hard data on this, but I think that it's much easier to be misusing the |
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.
sus
as the category SGTM.
I have a few suggestions on how to imrpove the documentation a bit.
Also about the tests: Is there a technical reason why all of those tests have to be in their own file? We usually only separate into different files if the test would otherwise get way too big or if we have auto-fixable and non-auto-fixable suggestions in a lint.
I recommend putting all the tests in one file and put the separate test cases in different functions, that are named like the current file names.
@flip1995 I fixed the documentation, thanks for reviewing!
No technical reason, just makes more sense to me to separate each test to a different file. It's more of a personal preference. |
I would prefer to keep the tests in line with our other tests. I think it is easier to get an overview of what is tested and compare lint messages and suggestions when they are all in one file (as long as it doesn't get way to big). I can see why you would prefer the split up test files and in the PR-view this all looks good. But I think later in the file-view, you would have to click/open too many files to see what tests are there and what tests might be missing. |
Got you, np |
@flip1995 I got to it quicker than I expected 😄 |
Splitting it into Arc and Rc makes sense. I'm good with tests/documentation now. I didn't review the code, so I leave the final r+ to @xFrednet |
@xFrednet One last check to see everything is squashed correctly please and I think we're good to go 😬 |
Everything looks good to me, and the squash is also alright 👍. Thank you for the lint implementation. I hope you also had fun 🙃 @bors r+ |
📌 Commit feb6d8c has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
It sure was a nice experience, contributing to this project. |
… r=xFrednet add suggestions to rc_clone_in_vec_init A followup to #8769 I also switch the order of the 2 suggestions, since the loop initialization one is probably the common case. `@xFrednet` I'm not letting you guys rest for a minute 😅 changelog: add suggestions to [`rc_clone_in_vec_init`]
Closes #8719
changelog: Introduce [
rc_clone_in_vec_init
] lint