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
I know, this is quite a corner case. However I found that Style/Next autocorrection can break valid Ruby files unless Style/MultilineIfThen is also enabled.
Test case
# rubocop:disable Style/MultilineIfThen
[].each do |a|
if a then
puts
puts
puts
end
end
Expected behavior
Either file doesn't get modified, or invalid then is removed during the transformation.
Actual behavior
[].each do |a|
next unless a then
puts
puts
puts
end
(which is invalid Ruby code)
Steps to reproduce the problem
Put test case in a test.rb file
Run rubocop -a
RuboCop version
0.38.0 (using Parser 2.3.0.6, running on ruby 2.2.4 x86_64-darwin14)
The text was updated successfully, but these errors were encountered:
I know, this is quite a corner case. However I found that Style/Next autocorrection can break valid Ruby files unless Style/MultilineIfThen is also enabled.
Test case
Expected behavior
Either file doesn't get modified, or invalid
then
is removed during the transformation.Actual behavior
(which is invalid Ruby code)
Steps to reproduce the problem
test.rb
filerubocop -a
RuboCop version
The text was updated successfully, but these errors were encountered: