Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Fix clippy error to add clippy job on Ci #659

Merged
merged 10 commits into from
Nov 3, 2022
Merged

Fix clippy error to add clippy job on Ci #659

merged 10 commits into from
Nov 3, 2022

Conversation

unvalley
Copy link
Contributor

@unvalley unvalley commented Oct 10, 2022

Related PR

This PR is for #673

What does this PR do?

  • add Run Clippy job to CI (rust.yml)
  • apply cargo clippy --fix command
  • fix some cargo clippy error manually (but warnings still remain on tests)

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

@ehiggs ehiggs mentioned this pull request Oct 13, 2022
3 tasks
@unvalley unvalley marked this pull request as ready for review October 15, 2022 01:28
@unvalley unvalley changed the title Add clippy job to CI Add clippy job to CI and fix clippy error Oct 15, 2022
bors bot added a commit that referenced this pull request Oct 20, 2022
665: Fixing piles of clippy errors. r=ManyTheFish a=ehiggs

## Related issue
No issue fixed. Simply cleaning up some code for clippy on the march towards a clean build when #659 is merged.

## What does this PR do?
Most of these are calling clone when the struct supports Copy.

Many are using & and &mut on `self` when the function they are called from already has an immutable or mutable borrow so this isn't needed.

I tried to stay away from actual changes or places where I'd have to name fresh variables.

## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Co-authored-by: Ewan Higgs <ewan.higgs@gmail.com>
@curquiza
Copy link
Member

@unvalley
Sorry, since we merged #665 related to your work, you have a lot of git conflict. Can you fix them?
I would keep at least the addition of the CI in your PR, which is really useful for us! Thank you 🙏

@curquiza curquiza self-requested a review October 20, 2022 10:07
@unvalley
Copy link
Contributor Author

@curquiza No problem, I'll fix the conflicts!

@unvalley
Copy link
Contributor Author

unvalley commented Oct 20, 2022

@curquiza I've fixed conflicts by accepting all current (main) change. The last commit passes cargo clippy (but as I described, there are still warnings).
Please take a look?

@curquiza
Copy link
Member

For me it's ok for the CI side @ManyTheFish (or some else in @meilisearch/core-team) I let you review the code base part before merging

@curquiza curquiza added the no breaking The related changes are not breaking (DB nor API) label Oct 20, 2022
@curquiza
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 20, 2022
@bors
Copy link
Contributor

bors bot commented Oct 20, 2022

try

Build failed:

@curquiza
Copy link
Member

@unvalley looks like the CIs are all failing, could you fix this before the core team review your PR?

@curquiza
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 24, 2022
@bors
Copy link
Contributor

bors bot commented Oct 24, 2022

try

Build failed:

@unvalley
Copy link
Contributor Author

I have to fix all warnings to pass the CI.

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

The RUSTFLAGS -D warnings denies all warnings and this pr has warnings by clippy now.

@curquiza
Copy link
Member

@unvalley, how big is it. Do you want to provide another PR before merging this one fixing all the conflicts?

@unvalley
Copy link
Contributor Author

unvalley commented Oct 24, 2022

@curquiza
There are 24 clippy errors (by -D warnings).
So, that's not too big. I work to fix the errors in this PR and I use #allow(clippy::lint) in some places to merge this PR asap.

@curquiza
Copy link
Member

@unvalley thank you very much this is really appreciated 🙏

@unvalley
Copy link
Contributor Author

unvalley commented Oct 24, 2022

@curquiza Could you try bors? 🙏
I've checked that cargo clippy -- -D warnings finished successfully on my machine.

@curquiza
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 24, 2022
@bors
Copy link
Contributor

bors bot commented Oct 24, 2022

try

Build failed:

@ehiggs ehiggs mentioned this pull request Oct 24, 2022
3 tasks
@unvalley
Copy link
Contributor Author

bors try

@bors
Copy link
Contributor

bors bot commented Oct 25, 2022

🔒 Permission denied

Existing reviewers: click here to make unvalley a reviewer

@unvalley
Copy link
Contributor Author

fixed rust fmt🔥

@curquiza
Copy link
Member

Bors try

bors bot added a commit that referenced this pull request Oct 28, 2022
@bors
Copy link
Contributor

bors bot commented Oct 28, 2022

try

Build failed:

@unvalley unvalley changed the title Add clippy job to CI and fix clippy error Fix clippy error to add clippy job on Ci Oct 28, 2022
Remove clippy job

Fix clippy error type_complexity

Restore ambiguous change
@unvalley
Copy link
Contributor Author

@curquiza
I finally removed the clippy job in this pr to receive a code review for the current code change.
I'll add the job in this pr.

@curquiza
Copy link
Member

Ok @unvalley!
Can you remove the issue from the Development section (on the right) then?

Copy link
Member

@irevoire irevoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @unvalley, to me we're almost finished, there is just two last things that I would like to check but overall I think we can merge

filter-parser/src/lib.rs Outdated Show resolved Hide resolved
milli/src/search/facet/filter.rs Outdated Show resolved Hide resolved
@irevoire
Copy link
Member

Hey @unvalley, since this is quite a big PR and you had to rebase a lot of changes we wanted to thank you for your time and accept your contribution for the hacktoberfest even though we're probably not going to merge it before the end of the event.
That's why I gave you the hacktoberfest-accepted tag.
And if you would like to receive some swag from Meilisearch, please complete this form.

Co-authored-by: Tamo <irevoire@protonmail.ch>
@unvalley
Copy link
Contributor Author

@irevoire Thanks for letting me know! I completed the form. I'd like to contribute more.

@curquiza
Copy link
Member

And thanks for being such reactive @unvalley! You are more than welcome to contributing again 😄

@curquiza curquiza mentioned this pull request Oct 31, 2022
3 tasks
@unvalley unvalley requested review from irevoire and removed request for ManyTheFish November 1, 2022 12:53
@unvalley unvalley requested review from Kerollmops and removed request for irevoire November 3, 2022 08:36
Copy link
Member

@irevoire irevoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to me, since the PR is quite large I'll let someone else from the @meilisearch/core-team double-review + merge

@curquiza
Copy link
Member

curquiza commented Nov 3, 2022

@Kerollmops could you take a look at it? And if you approve the PR, please merge it 🚀

Copy link
Member

@Kerollmops Kerollmops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of changes but it looks good to me too!
Thank you very much ❤️

bors merge

@bors
Copy link
Contributor

bors bot commented Nov 3, 2022

@bors bors bot merged commit 6add470 into meilisearch:main Nov 3, 2022
@meili-bot
Copy link
Contributor

This message is sent automatically

Thank you for contributing to Meilisearch. If you are participating in Hacktoberfest, and you would like to receive some gift from Meilisearch too, please complete this form.

@unvalley unvalley deleted the add-clippy-to-ci branch November 3, 2022 16:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no breaking The related changes are not breaking (DB nor API)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants