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
…ing`
Fixesrubocop#9089
This PR fixes an incorrect auto-correct for `Style/FormatString`
when using springf with second argument that uses an operator.
Expected behavior
Autocorrect should not change the behavior of the code.
Actual behavior
Autocorrect changed the behavior of the code.
Steps to reproduce the problem
Add
test.rb
:Run
ruby test.rb
, it will print "0004".Add
.rubocop.yml
:Run
rubocop --auto-correct test.rb
in command line.The auto-corrected
test.rb
will be:It will raise
test.rb:2:in '+': no implicit conversion of Integer into String (TypeError)
when running it.Expect the corrected
test.rb
to beRuboCop version
The text was updated successfully, but these errors were encountered: