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 #10529] Fix autocorrect for Style/SoleNestedConditional #10532

Merged

Conversation

nobuyo
Copy link
Contributor

@nobuyo nobuyo commented Apr 12, 2022

Fixes #10529


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@nobuyo nobuyo changed the title [Fix #10529] Fix autocorrect for Style/SoleNestedConditional causes… [Fix #10529] Fix autocorrect for Style/SoleNestedConditional Apr 12, 2022
@nobuyo
Copy link
Contributor Author

nobuyo commented Apr 12, 2022

CI / windows 3.1 has failed, but I have a feeling it's not due to my changes 🤔

@ydah
Copy link
Member

ydah commented Apr 12, 2022

I don't know if this is the right way to handle this, but wouldn't running CI again solve the problem?
I sometimes encounter that too🤔

@koic
Copy link
Member

koic commented Apr 13, 2022

Yep, probably a false alarm due to an unstable test.

@nobuyo
Copy link
Contributor Author

nobuyo commented Apr 13, 2022

I'd like to do git rebase -i master again.

@koic
Copy link
Member

koic commented Apr 13, 2022

This looks good. Can you squash your commits into one?

… causes logical error when using a outer condition of method call by omitting parentheses for method arguments.

Update changelog/fix_autocorrect_for_style_sole_nested_confitional.md

Co-authored-by: Koichi ITO <koic.ito@gmail.com>

Update spec/rubocop/cop/style/sole_nested_conditional_spec.rb

Co-authored-by: Koichi ITO <koic.ito@gmail.com>
@nobuyo nobuyo force-pushed the fix-style-sole-nested-conditional-correction branch from 8fecd94 to a53d574 Compare April 13, 2022 01:37
@nobuyo
Copy link
Contributor Author

nobuyo commented Apr 13, 2022

Thanks for your review, updated branch.

@koic koic merged commit fab96a5 into rubocop:master Apr 13, 2022
@koic
Copy link
Member

koic commented Apr 13, 2022

Thanks!

@zw963
Copy link

zw963 commented May 1, 2022

This fix works on 1.28.2, thank you.

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.

rubocop -a cause logic error with Style/SoleNestedConditional cop on version 1.27 + ruby 3.1
4 participants