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

Auto correct breaks if statement #9105

Closed
baelter opened this issue Nov 26, 2020 · 0 comments · Fixed by #9107
Closed

Auto correct breaks if statement #9105

baelter opened this issue Nov 26, 2020 · 0 comments · Fixed by #9107
Labels

Comments

@baelter
Copy link

baelter commented Nov 26, 2020

Expected behavior

a = if b
      b
    else
      c + d
    end

Should auto correct to:

a = b || (c + d)

Actual behavior

a = b || +d

RuboCop version

rubocop -V
1.4.2 (using Parser 2.7.2.0, rubocop-ast 1.1.1, running on ruby 2.7.2 x86_64-darwin19)
@koic koic added the bug label Nov 26, 2020
koic added a commit to koic/rubocop that referenced this issue Nov 26, 2020
…Condition`

Fixes rubocop#9105

This PR fixes an incorrect auto-correct for `Style/RedundantCondition`
when using operator method in `else`.
bbatsov pushed a commit that referenced this issue Nov 26, 2020
Fixes #9105

This PR fixes an incorrect auto-correct for `Style/RedundantCondition`
when using operator method in `else`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants