Skip to content
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

Fix InternalAffairs/NumblockHandler offenses #1362

Merged
merged 45 commits into from Aug 25, 2022

Conversation

ydah
Copy link
Member

@ydah ydah commented Aug 16, 2022

In this PR, corrections were made to the following internal cop additions where they were in offense.

This PR correction of each offense for each cop in separate commits, just as we did with the original PR.


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • [-] Squashed related commits together.
  • Added tests.
  • [-] Updated documentation.
  • [-] Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

If you have created a new cop:

  • Added the new cop to config/default.yml.
  • The cop is configured as Enabled: pending in config/default.yml.
  • The cop is configured as Enabled: true in .rubocop.yml.
  • The cop documents examples of good and bad code.
  • The tests assert both that bad code is reported and that good code is not reported.
  • Set VersionAdded in default/config.yml to the next minor version.

If you have modified an existing cop's configuration options:

  • Set VersionChanged in config/default.yml to the next major version.

@bquorning
Copy link
Collaborator

Can you briefly explain why the cop in some cases is disabled, and in some cases you can just add an alias? It has something to do with the number or type of arguments being passed to the block?

@ydah ydah force-pushed the fix/InternalAffairs/NumblockHandler branch 2 times, most recently from 2b3cddf to f98f442 Compare August 16, 2022 09:53
@ydah
Copy link
Member Author

ydah commented Aug 16, 2022

For the following cop that I added aliases to, I targeted the ones that take block arguments.

All cop that use on_block are subject to InternalAffairs/NumblockHandler, so most of the cop that check describe and context are in offense. But I don't think they should be represented as numblock in the first place, so I disabled them.

Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

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

@Darhazer, would you have a look as well?

lib/rubocop/cop/rspec/around_block.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/empty_line_after_hook.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/expect_in_hook.rb Show resolved Hide resolved
lib/rubocop/cop/rspec/factory_bot/create_list.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/hook_argument.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/hooks_before_examples.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/iterated_expectation.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/yield.rb Show resolved Hide resolved
ydah added a commit to ydah/rubocop-rspec that referenced this pull request Aug 17, 2022
@ydah ydah force-pushed the fix/InternalAffairs/NumblockHandler branch from f98f442 to 61696b7 Compare August 17, 2022 01:30
@ydah ydah requested a review from Darhazer August 17, 2022 01:33
@ydah
Copy link
Member Author

ydah commented Aug 17, 2022

I update this PR. Thank you so much.

Copy link
Member

@Darhazer Darhazer left a comment

Choose a reason for hiding this comment

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

Since this upgrades some of the cops to handle numb locks, it deserves a changeling entry

lib/rubocop/cop/rspec/around_block.rb Outdated Show resolved Hide resolved
lib/rubocop/cop/rspec/iterated_expectation.rb Outdated Show resolved Hide resolved
@ydah ydah force-pushed the fix/InternalAffairs/NumblockHandler branch from 61696b7 to 130c2ea Compare August 17, 2022 10:01
@ydah
Copy link
Member Author

ydah commented Aug 17, 2022

I update this PR. Thank you so much.

@ydah ydah requested a review from Darhazer August 17, 2022 10:02
Copy link
Member

@Darhazer Darhazer left a comment

Choose a reason for hiding this comment

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

Final finishing touches and we're ready to go 🚀

CHANGELOG.md Outdated Show resolved Hide resolved
@ydah ydah force-pushed the fix/InternalAffairs/NumblockHandler branch from 130c2ea to 1f36197 Compare August 17, 2022 13:29
@ydah ydah requested a review from Darhazer August 17, 2022 13:32
Copy link
Member

@Darhazer Darhazer left a comment

Choose a reason for hiding this comment

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

Thank you 🙇 🚀 :shipit:

@ydah ydah requested a review from bquorning August 18, 2022 04:48
@ydah ydah mentioned this pull request Aug 19, 2022
13 tasks
Copy link
Collaborator

@bquorning bquorning left a comment

Choose a reason for hiding this comment

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

Looks fine as far as I can tell.

@bquorning bquorning merged commit 425bc13 into rubocop:master Aug 25, 2022
@ydah ydah deleted the fix/InternalAffairs/NumblockHandler branch August 25, 2022 12:33
ydah added a commit to rubocop/rubocop-factory_bot that referenced this pull request Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants