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

Follow up #1692 #1730

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Follow up #1692 #1730

merged 1 commit into from
Oct 4, 2023

Conversation

ydah
Copy link
Member

@ydah ydah commented Oct 3, 2023

Follow up: #1692 (comment)

❯ bundle exec rubocop -A
Inspecting 291 files
...........................................................................................................................................C.......................................................................................................................................................

Offenses:

lib/rubocop/cop/rspec/void_expect.rb:55:11: C: [Corrected] Workit/RedundantBooleanConditional: This conditional expression can just be replaced by parent.block_type? && parent.body == expect.
          true if parent.block_type? && parent.body == expect
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

291 files inspected, 1 offense detected, 1 offense corrected

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).

Follow up: #1692 (comment)

```
❯ bundle exec rubocop -A
Inspecting 291 files
...........................................................................................................................................C.......................................................................................................................................................

Offenses:

lib/rubocop/cop/rspec/void_expect.rb:55:11: C: [Corrected] Workit/RedundantBooleanConditional: This conditional expression can just be replaced by parent.block_type? && parent.body == expect.
          true if parent.block_type? && parent.body == expect
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

291 files inspected, 1 offense detected, 1 offense corrected
```
@ydah ydah changed the title Follow up #1692#discussion_r1288432020 Follow up #1692 Oct 3, 2023
@ydah
Copy link
Member Author

ydah commented Oct 3, 2023

memo) I proposed improving cop to do this detection, but the merge was not done:

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Looks great!

I am sorry to hear about the cop. Sometimes it’s useful, like here.

@ydah
Copy link
Member Author

ydah commented Oct 3, 2023

The cop is in the following gem:

https://github.com/ydah/workitcop

This gem is placing some things that unfortunately we did not adopt for RuboCop's cop or some things that I personally use 👍

@ydah ydah merged commit 725c2b4 into master Oct 4, 2023
22 checks passed
@ydah ydah deleted the followup branch October 4, 2023 12:58
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.

2 participants