Fix string interpolation detection again to be even broader
- My approach wasn't quite good enough. Replace it with what RuboCop itself does to detect all forms of string interpolation.
This commit is contained in:
parent
0889593e2a
commit
c1de3dfb90
@ -42,8 +42,8 @@ module RuboCop
|
|||||||
child.each_node(:send) do |send_node|
|
child.each_node(:send) do |send_node|
|
||||||
# Skip (nested) livecheck blocks as its `url` is different to a download `url`.
|
# Skip (nested) livecheck blocks as its `url` is different to a download `url`.
|
||||||
next if send_node.method_name == :livecheck || inside_livecheck_block?(send_node)
|
next if send_node.method_name == :livecheck || inside_livecheck_block?(send_node)
|
||||||
# Skip string interpolations (`:send` inside `:begin` inside `:dstr`).
|
# Skip string interpolations.
|
||||||
next if send_node.parent.begin_type? && send_node.parent.parent.dstr_type?
|
next if send_node.ancestors.drop_while { |a| !a.begin_type? }.any?(&:dstr_type?)
|
||||||
next if ON_SYSTEM_METHODS.include?(send_node.method_name)
|
next if ON_SYSTEM_METHODS.include?(send_node.method_name)
|
||||||
|
|
||||||
names.add(send_node.method_name)
|
names.add(send_node.method_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user