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
This change fixes autocorrection for Style/IfWithSemicolon when elsif present.
In case of one of more elsif conditions present, the autocorrector will create a full if, elsif, else structure.
This change fixes autocorrection for Style/IfWithSemicolon when elsif present.
In case of one of more elsif conditions present, the autocorrector will create a full if, elsif, else structure.
Style/IfWithSemicolon auto-correction produces syntactically invalid code when
if
semicolon statement also includeselsif
semicolon statement.Expected behavior
I would expect it to produce valid code or not try to auto-correct at all.
Actual behavior
Style/IfWithSemicolon auto-correction produces code that has syntax error.
In more detail, when trying to auto-correct statements that include
if;
andelsif;
rubocop produces syntactically invalid code.Steps to reproduce the problem
Run it on any file that contains structure similar to:
You can then see that it produces =>
which is obviously syntactically invalid.
RuboCop version
The text was updated successfully, but these errors were encountered: