-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
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
Bug in StringLiteralsInInterpolation #1415
Comments
Confirmed. That's a bug. I'll fix it. |
…tion_bug [Fix #1415] Handle backslash-concatenation
Confirmed: this cop seems to work fine now. 🍰 thanks! |
Same topic, so I'm posting here: Tested on: @be1f42030fce (master) This works: foo "#{'bax'}" ... but this doesn't: foo " #{'bax'}" (The space causes the problem.)
|
@e2 I have not been able to reproduce your problem. The message from StringLiteralsInInterpolation:
EnforcedStyle: double_quotes so both your examples should be reported as violations. Please double-check by putting both examples in the same file and see what you get. If there is a problem, open a new issue. |
Sorry, I should have provided everything to reproduce the problem. Here's a script: #!/bin/sh
url="https://raw.githubusercontent.com/thoughtbot/hound/master/config/style_guides/ruby.yml"
dir="./interpolation_test"
rev="be1f42030fce726da1689335ce3005cd508184f7"
mkdir -p "${dir}"
cd "${dir}"
[ -e ruby.yml ] || wget -O .rubocop.yml "${url}"
[ -e Gemfile ] || echo "gem 'rubocop', github: 'bbatsov/rubocop', ref: '${rev}'" > Gemfile
bundle install --quiet
bundle show rubocop
rm -f foo.rb
cat > foo.rb <<EOS
foo "#{bar}#{'all'}"
foo "#{bar} #{'all'}"
EOS
bundle exec rubocop foo.rb Expected: 2 errors, regardless of what they are |
Just wondering, what about: |
@vinagrito Did you mean, why doesn't RuboCop report the single quotes in the first example if the preference is It looks like this cop, and some others that deal with interpolation, miss the symbol literal case. |
@jonas054 gotcha |
Since there isn’t any interpolation into the given string, this looks like a bug.
The text was updated successfully, but these errors were encountered: