Skip to content

add suppress_restriction_lint_in_const config #9920

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

Merged
merged 7 commits into from
Dec 6, 2022

Conversation

naosense
Copy link
Contributor

@naosense naosense commented Nov 21, 2022

According to #9808 , add a new lint suppress_lint_in_const to report even in const context. BTW, i am not good at naming either, if anyone have a better idea, i am happy to change it.

This PR is still in progress, so i keep it draft.

  • Followed [lint naming conventions][lint_naming]
  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Added lint documentation
  • Run cargo dev fmt

changelog: Enhancement: [indexing_slicing]: add new config suppress-restriction-lint-in-const to enable restriction lints, even if the suggestion might not be applicable

r? @xFrendet

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Alexendoo (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 21, 2022
@naosense
Copy link
Contributor Author

r? @xFrednet

@rust-highfive rust-highfive assigned xFrednet and unassigned Alexendoo Nov 21, 2022
@naosense naosense marked this pull request as ready for review November 22, 2022 09:25
@naosense
Copy link
Contributor Author

Hey @xFrednet , i think it's ready to go. Could you please review it?

Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

Really solid start! Thank you for working on this issue :)

I hope that these suggestions are fairly simple. You're welcome to reach out if you'd like any help :)

@bors
Copy link
Contributor

bors commented Nov 22, 2022

☔ The latest upstream changes (presumably #9924) made this pull request unmergeable. Please resolve the merge conflicts.

@naosense naosense force-pushed the suppress_lint_in_const branch from 4da3bbd to 9c0d3f2 Compare November 23, 2022 08:44
@naosense
Copy link
Contributor Author

@xFrednet thanks for your kindness and patience! Not quite sure everything is corrected as you requested, could you please review again?

@xFrednet xFrednet changed the title add suppress_lint_in_const config add suppress_restriction_lint_in_const config Nov 23, 2022
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

@xFrednet thanks for your kindness and patience!

You're very welcome. Thank you for your kindness and contribution as well!

Not quite sure everything is corrected as you requested, could you please review again?

Yes, I have one suggestion, and then it should be good to go!

@naosense naosense requested a review from xFrednet November 24, 2022 01:47
@naosense
Copy link
Contributor Author

ping ping @xFrednet , let me know if anything wrong with my code.😄

@xFrednet
Copy link
Member

Hey @naosense, everything is fine. It can sometimes take a few days, until I and other team members have time to review a PR. If you don't hear anything, it's nothing bad and a ping after some time can be helpful.

I generally aim to give a review within 5 days, but it can go up to a week, if life gets busy or there are several other reviews waiting. This one is the next proper review in my queue. Maybe you'll get a review today, but it's more likely that it'll be tomorrow. :)

@naosense
Copy link
Contributor Author

@xFrednet got it, didn't know that before, I'm fine with any time, just follow your schedule

Copy link
Member

@xFrednet xFrednet left a 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! The tests still need some adjustment and then we can merge this :)

@xFrednet
Copy link
Member

Hey @naosense

got it, didn't know that before, I'm fine with any time, just follow your schedule

No problem. It's something I needed to get used to as well. You're welcome to reach out to me here or on Zulip if you're unsure about these things :)

@naosense naosense requested a review from xFrednet November 28, 2022 09:41
@bors
Copy link
Contributor

bors commented Nov 28, 2022

☔ The latest upstream changes (presumably #9865) made this pull request unmergeable. Please resolve the merge conflicts.

@naosense naosense force-pushed the suppress_lint_in_const branch from d01f15e to 2ac83f9 Compare November 29, 2022 07:03
Copy link
Member

@xFrednet xFrednet left a comment

Choose a reason for hiding this comment

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

Almost perfect, I found one last nit, which should be simple to fix.

Could you then squash the fix test commits into one? Afterwards, we can merge this. Thank you for the effort you put into this, it's highly appreciated :)

/// suggested counterparts are unavailable in constant code. This
/// configuration will cause restriction lints to trigger even
/// if no suggestion can be made.
(suppress_restriction_lint_in_const: bool = false),
Copy link
Member

Choose a reason for hiding this comment

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

The description sounds perfect :)

@naosense naosense force-pushed the suppress_lint_in_const branch from 2ac83f9 to eec5039 Compare December 3, 2022 08:07
@naosense naosense requested a review from xFrednet December 3, 2022 08:07
@xFrednet
Copy link
Member

xFrednet commented Dec 5, 2022

This looks good to me. Thank you for all the work you put into this and the quick updates. I hope you had fun working on this. It's an excellent addition to Clippy IMO.

@bors r+

@bors
Copy link
Contributor

bors commented Dec 5, 2022

📌 Commit eec5039 has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 5, 2022

⌛ Testing commit eec5039 with merge 9c1ba16...

bors added a commit that referenced this pull request Dec 5, 2022
add `suppress_restriction_lint_in_const` config

According to #9808 , add a new lint `suppress_lint_in_const` to report even in const context. BTW, i am not good at naming either, if anyone have a better idea, i am happy to change it.

This PR is still in progress, so i keep it draft.

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

changelog: Enhancement: [`indexing_slicing`]: add new config `suppress-restriction-lint-in-const` to enable restriction lints, even if the suggestion might not be applicable

r? `@xFrendet`
@bors
Copy link
Contributor

bors commented Dec 5, 2022

💔 Test failed - checks-action_test

@xFrednet
Copy link
Member

xFrednet commented Dec 5, 2022

Looks like a fluke.

@bors retry

Be nice and let the CI be green this time :)

@bors
Copy link
Contributor

bors commented Dec 5, 2022

⌛ Testing commit eec5039 with merge 3af38ec...

bors added a commit that referenced this pull request Dec 5, 2022
add `suppress_restriction_lint_in_const` config

According to #9808 , add a new lint `suppress_lint_in_const` to report even in const context. BTW, i am not good at naming either, if anyone have a better idea, i am happy to change it.

This PR is still in progress, so i keep it draft.

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

changelog: Enhancement: [`indexing_slicing`]: add new config `suppress-restriction-lint-in-const` to enable restriction lints, even if the suggestion might not be applicable

r? `@xFrendet`
@bors
Copy link
Contributor

bors commented Dec 5, 2022

💔 Test failed - checks-action_test

@xFrednet
Copy link
Member

xFrednet commented Dec 5, 2022

It looks like something in the CI is broken. This is not specific to this PR. I'll merge it, once the problem has been resolved :)

@xFrednet xFrednet added S-waiting-on-bors Status: The marked PR was approved and is only waiting bors and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Dec 6, 2022
@xFrednet
Copy link
Member

xFrednet commented Dec 6, 2022

Let's give this another try

@bors r+

@bors
Copy link
Contributor

bors commented Dec 6, 2022

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Use ubuntu-20.04 instead of ubuntu-latest #10039

@bors
Copy link
Contributor

bors commented Dec 6, 2022

📌 Commit eec5039 has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 6, 2022

⌛ Testing commit eec5039 with merge 5d70746...

@bors
Copy link
Contributor

bors commented Dec 6, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 5d70746 to master...

@bors bors merged commit 5d70746 into rust-lang:master Dec 6, 2022
@naosense naosense deleted the suppress_lint_in_const branch December 6, 2022 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: The marked PR was approved and is only waiting bors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants