We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi rubocop teams, I found rubocop incorrectly fixes the LiteralInInterpolation.
This bug causes the Ruby program behave different between before/after being fixed by rubocop's auto-correct.
$ cat a.rb # puts "Hey, #{0x20}" $ rubocop a.rb -a <output omitted> $ cat a.rb # puts 'Hey, 32'
$ cat a.rb # puts "Hey, #{0x20}" $ rubocop a.rb -a <output omitted> $ cat a.rb # puts 'Hey, 0x20' <----- incorrect!
Invoke rubocop without auto-correct, it shows:
Inspecting 1 file W Offenses: a.rb:1:14: W: Lint/LiteralInInterpolation: Literal interpolation detected. puts "Hey, #{0x20}" ^^^^ 1 file inspected, 1 offense detected
Prepare a.rb:
a.rb
puts "Hey, #{0x20}"
then
$ rubocop -a a.rb
Include the output of rubocop -V. Here's an example:
rubocop -V
$ rubocop -V 0.55.0 (using Parser 2.5.1.0, running on ruby 2.4.3 x86_64-linux)
The text was updated successfully, but these errors were encountered:
[Fix rubocop#5862] Fix incorrect autocorrect `Lint/LiteralInInterpola…
67e4672
…tion` Fixes rubocop#5862. This PR fixes an incorrect auto-correct for `Lint/LiteralInInterpolation` if contains numbers.
Lint/LiteralInInterpolation
Thanks for the feedback. I confirmed this reproduction. I opened a PR #5863.
Sorry, something went wrong.
[Fix #5862] Fix incorrect autocorrect Lint/LiteralInInterpolation
fe310a7
Fixes #5862. This PR fixes an incorrect auto-correct for `Lint/LiteralInInterpolation` if contains numbers.
Successfully merging a pull request may close this issue.
Hi rubocop teams,
I found rubocop incorrectly fixes the LiteralInInterpolation.
This bug causes the Ruby program behave different between before/after being fixed by rubocop's auto-correct.
Expected behavior
Actual behavior
Invoke rubocop without auto-correct, it shows:
Steps to reproduce the problem
Prepare
a.rb
:then
RuboCop version
Include the output of
rubocop -V
. Here's an example:The text was updated successfully, but these errors were encountered: