Distilled from a real world example (https://github.com/seomoz/qless/blob/9e5ef9cae19ef8ba59d0ac51636bf068aa0ff9a1/spec/integration/qless_spec.rb#L2433). If I have:
# foo.rb
# Encoding: utf-8
def foo
return 1, 2
end
If I then run rubocop -a foo.rb, it generates invalid ruby:
# foo.rb
# Encoding: utf-8
def foo
1, 2
end
Excellent work finding these bugs! I'll take this one too.
I think the auto-correction in this case should produce
# foo.rb
# Encoding: utf-8
def foo
[1, 2]
end
The other alternative would be to leave it unchanged, but I prefer to change it.
@jonas054 Autocorrect this to an array as you suggested.
Most helpful comment
Excellent work finding these bugs! I'll take this one too.
I think the auto-correction in this case should produce
The other alternative would be to leave it unchanged, but I prefer to change it.