Fix detection of string interpolation
- This was almost there but not quite and the lack of tests lulled me into a false sense of security.
This commit is contained in:
parent
bc796a3120
commit
b82c5f1d36
@ -44,8 +44,8 @@ module RuboCop
|
||||
next if send_node.method_name == :livecheck
|
||||
next if send_node.parent.block_type? && send_node.parent.method_name == :livecheck
|
||||
|
||||
# Skip string interpolations (`:begin` inside `:dstr`).
|
||||
next if send_node.begin_type? && send_node.parent_node.dstr_type?
|
||||
# Skip string interpolations (`:send` inside `:begin` inside `:dstr`).
|
||||
next if send_node.parent.begin_type? && send_node.parent.parent.dstr_type?
|
||||
next if ON_SYSTEM_METHODS.include?(send_node.method_name)
|
||||
|
||||
names.add(send_node.method_name)
|
||||
|
||||
@ -43,7 +43,7 @@ describe RuboCop::Cop::Cask::NoOverrides do
|
||||
<<~CASK
|
||||
cask 'foo' do
|
||||
arch arm: "arm64", intel: "x86"
|
||||
version = '1.2.3'
|
||||
version '1.2.3'
|
||||
on_mojave :or_later do
|
||||
url "https://brew.sh/foo-\#{version}-\#{arch}.pkg"
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user