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

handle exception in Rails/RedundantReceiverInWithOptions with empty body #6855

Conversation

ericsullivan
Copy link
Contributor

@ericsullivan ericsullivan commented Mar 21, 2019

I ran rubocop on our test suite and encountered an exception in Rails/RedundantReceiverInWithOptions caused by the block:

with_options if: :state? do |_object|
end

I'm not sure if it should ignore the block (the approach I took here) or flag it as unnecessary. In either case, I don't think it should raise an exception so I wanted to add this PR now, and if it should produce an error I can open an issue.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@ericsullivan ericsullivan force-pushed the handle_exception_in_redundant_receiver_in_with_options branch 2 times, most recently from 0ef01ca to 64f0210 Compare March 21, 2019 12:51
@ericsullivan
Copy link
Contributor Author

I'm not sure what happened with the ci/circleci: ruby-2.3-spec job. Is that related to this PR or a known issue?

@koic
Copy link
Member

koic commented Mar 22, 2019

Occasionally CircleCI makes a mistake in the report. It seems that this has occurred.
This changes look good to me. Can you squash your commits into one?

@ericsullivan ericsullivan force-pushed the handle_exception_in_redundant_receiver_in_with_options branch from e910e1d to 13f11f4 Compare March 22, 2019 01:37
@ericsullivan
Copy link
Contributor Author

squashed, thanks for reviewing @koic

@koic koic merged commit 2df1e20 into rubocop:master Mar 22, 2019
@koic
Copy link
Member

koic commented Mar 22, 2019

Thanks too!

@ericsullivan ericsullivan deleted the handle_exception_in_redundant_receiver_in_with_options branch March 22, 2019 02:14
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

2 participants