You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…Condition`
Fixesrubocop#8299
This PR fixes an incorrect auto-correct for `Style/RedundantCondition`
when using `raise`, `rescue`, or `and` without argument parentheses in `else`.
Fixes#8299
This PR fixes an incorrect auto-correct for `Style/RedundantCondition`
when using `raise`, `rescue`, or `and` without argument parentheses in `else`.
In certain situations, Style/RedundantCondition can generate a syntax errors.
Expected behavior
I'd expect rubocop to either not auto correct (since it was supposed to be a safe auto-correction), or to not generate invalid code.
Actual behavior
rubocop generated code with invalid syntax.
Steps to reproduce the problem
I had a code like this:
Style/RedundantReturn corrected it to:
Which then Style/RedundantCondition auto corrected to:
RuboCop version
The text was updated successfully, but these errors were encountered: