-
-
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
Interpolated variables not enclosed in braces are not noticed #59
Comments
This certainly is a bug, that we'll address soon. On a related note - interpolating variables like this is considered bad style(it's a remnant of the ancient Ruby history), so we should add a check for this as well. |
@jonas054 Here's where the problem with the existing check lies:
The code in |
Thanks, I'll try to solve it tonight. |
That won't be needed - I got a bit of an inspiration and fixed it myself :-) I've also implemented a cop to warn against the use of interpolated variables. |
Great! |
When you interpolate global, instance or class variables in strings you can omit the enclosing braces. But RuboCop does not notice variables not enclosed in braces and gives a misleading warnings of
as double-quotation is required for the strings in question.
For example, consider the following code:
When inspecting this rubocop says
But replacing the strings with single-quoted ones will not allow for interpolation.
The text was updated successfully, but these errors were encountered: