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
rubocop -D -a
Inspecting 1 file
E
Offenses:
test.rb:1:1: C: [Corrected] Style/EmptyCaseCondition: Do not use empty case condition, instead use an if expression.
case
^^^^
test.rb:2:11: E: unexpected token tCOMMA
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
if my.foo?, my.bar?
^
test.rb:4:1: E: unexpected token kELSIF
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
elsif my.baz?
^^^^^
test.rb:6:1: E: unexpected token kEND
(Using Ruby 2.3 parser; configure using TargetRubyVersion parameter, under AllCops)
end
^^^
When first `when` condition of an empty case included comma-delimited
alternatives, autocorrect did not replace the comma with `||`.
This commit fixes the issue.
This is an issue about the
Style/EmptyCaseCondition
cop that wrongly autocorrects lines with multiples values.Given a file with :
Expected behavior
File should be modified to:
Actual behavior
File is modified to:
Rubocop output is :
RuboCop version
The text was updated successfully, but these errors were encountered: