-
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
Vec extend to append #7270
Vec extend to append #7270
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @flip1995 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @xFrednet This seems to be a good PR to review. |
The test keeps failing. Not sure what I'm doing wrong. I'm pretty new to the repo 😪 |
You can update the tests with
To get started with working on Clippy, make sure to read our documentation in |
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.
Hey @Valentine-Mario, you've come to the right place to ask :). I've added some comments to your code with explanations, how it can be improved.
The test keeps failing. Not sure what I'm doing wrong. I'm pretty new to the repo 😪
You have two tests which are failing:
- UI tests: these tests run Clippy on the
.rs
files insidetests/ui/
directory and then compare the output with the.stderr
file with the same name. You've correctly written thetests/ui/vec_extend_to_append.rs
file but the correspondingtests/ui/vec_extend_to_append.stderr
is missing. Our dev tool can copy it to the correct location withcargo dev bless
. - Test update_lints: This test verifies that
cargo dev update_lints
produces no changes. Your merge from master most likely altered something that results in a new output. You can simply reruncargo dev update_lints
. - Test fmt: This test didn't run, but it's likely that it would fail. You can simply fix this by running
cargo dev fmt
(Note: Thedev
is required because we're using a slightly different version thancargo fmt
)
It's usually good to run a few commands before every commit. This is roughly my procedure:
# Formatting the code base and tests
cargo dev fmt
# Running Clippy's tests
cargo test
# Updating UI test outputs if anything failed
cargo dev bless
# I usually only run this if `Test update_lints` fails but you can also run it every time as it's quite fast
cargo dev update_lints
# git add -A
# git commit -m "Your awesome commit message"
# git push
All of this might be a lot to take in, but your effort is appreciated, everyone started out like this. Feel free to ask if you're stuck or something is unclear 🙃
8de354d
to
64341cc
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.
Hey, I've added a comment with guidance for the next steps.
In regard to commits. You've now overridden your previous commits with a force push. This can be useful to clean up at the end but right now complicates the review and destroys links from previous comments. Could you please add the next changes in a new commit and also describe a bit better what you're doing in the message itself 🙃
119ccd4
to
8f6972e
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.
Hey @Valentine-Mario, I've reviewed your recent changes and added some suggestions. Don't let them overwhelm you, the implementation is getting better each time.
Added the updates. Sorry for the delay. It was weekend |
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.
Hey, thank you for the changes. You've also added the automatic applicability of the suggestion correctly. 👍
Here are some last annotations. You can fix the red pipeline by adjusting the lint description. I'll do a final review when you've addressed these comments.
Added the updates. Sorry for the delay. It was weekend
That's totally okay, you can take your time with these changes 🙃
Can you do a rebase, not merge? We follow a no-merge commit policy: https://github.com/rust-lang/rust-clippy/blob/master/doc/basics.md#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.
The rebase gone wrong: You have to force push after a rebase, instead of merging the rebased branch. You should be able to fix this by running:
$ git fetch upstream # assuming upstream is the remote of this repo
$ git rebase upstream/master
$ git diff origin/vec_extend_to_append # < This should be empty
$ git push --force-with-lease
0497dd1
to
c1dd158
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.
Thanks! Please squash your commit and this should be ready to go.
aa0dd65
to
189d139
Compare
Done |
There are some dogfood errors and you have to run |
189d139
to
be79701
Compare
done |
There are still 2 dogfood errors. |
be79701
to
0eb0ad8
Compare
☔ The latest upstream changes (presumably #7315) made this pull request unmergeable. Please resolve the merge conflicts. |
0eb0ad8
to
44608b1
Compare
Done |
@bors r+ Thanks! |
📌 Commit 44608b1 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
closes #7209 |
It has to be in the PR description before the merge. It's setup that way to allow the maintainers to double-check it beforehand. You can add it to future PRs :) |
This PR adds a check to suggest changes of vector from
could be written as
changelog: Add vec_extend_to_append lint
issue: #7209