Style/StringLiterals
does not work for String
s interpolated into a Regex
#12061
Labels
Style/StringLiterals
does not work for String
s interpolated into a Regex
#12061
To reproduce
With default settings, run RuboCop on:
/foo#{"sar".sub("s", "b")}/
Expected behavior
A
Style/StringLiterals
warning, or maybeStyle/StringLiteralsInInterpolation
.Actual behavior
No warnings.
RuboCop version
Other thoughts
Would it be better to use
Style/StringLiteralsInInterpolation
here, rather thanStyle/StringLiterals
? This would be consistent with other interpolations, however, the rule isn't quite as important in this case since there are no external"
to cause confusion, as there would be with aString
orSymbol
.The text was updated successfully, but these errors were encountered: