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
UnneededPercentQ
Example:
$ rubocop -v 0.35.1 $ cat ex.rb .rubocop.yml # encoding: utf-8 interpolation = 'hello' %Q(example "with quotes" and #{interpolation}) --- Style/BarePercentLiterals: EnforcedStyle: percent_q SupportedStyles: - percent_q - bare_percent $ rubocop ex.rb Inspecting 1 file C Offenses: ex.rb:5:1: C: Use %Q only for strings that contain both single quotes and double quotes, or for dynamic strings that contain double quotes. %Q(example "with quotes" and #{interpolation}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 file inspected, 1 offense detected
Gist for files in question: https://gist.github.com/backus/f341a4b92e54fa376211
Bisecting this points to 0ad7df5 I think
The text was updated successfully, but these errors were encountered:
Making the following change (which was present before #2274) seems to fix the issue and also does not break any specs
diff --git i/lib/rubocop/cop/style/unneeded_percent_q.rb w/lib/rubocop/cop/style/unneeded_percent_q.rb index 055f002..5bad397 100644 --- i/lib/rubocop/cop/style/unneeded_percent_q.rb +++ w/lib/rubocop/cop/style/unneeded_percent_q.rb @@ -16,7 +16,7 @@ module RuboCop STRING_INTERPOLATION_REGEXP = /#\{.+}/ def on_dstr(node) - check(node) + check(node) unless node.loc.expression.source =~ /"/ end def on_str(node)
Sorry, something went wrong.
I thought I was checking against master but looks like I had an old revision :(. Ignore me this was fixed #2419.
No branches or pull requests
Example:
Gist for files in question: https://gist.github.com/backus/f341a4b92e54fa376211
Bisecting this points to 0ad7df5 I think
The text was updated successfully, but these errors were encountered: