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:
Issy Long 2023-03-22 19:13:47 +00:00
parent bc796a3120
commit b82c5f1d36
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 3 additions and 3 deletions

View File

@ -44,8 +44,8 @@ module RuboCop
next if send_node.method_name == :livecheck next if send_node.method_name == :livecheck
next if send_node.parent.block_type? && send_node.parent.method_name == :livecheck next if send_node.parent.block_type? && send_node.parent.method_name == :livecheck
# Skip string interpolations (`:begin` inside `:dstr`). # Skip string interpolations (`:send` inside `:begin` inside `:dstr`).
next if send_node.begin_type? && send_node.parent_node.dstr_type? next if send_node.parent.begin_type? && send_node.parent.parent.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)

View File

@ -43,7 +43,7 @@ describe RuboCop::Cop::Cask::NoOverrides do
<<~CASK <<~CASK
cask 'foo' do cask 'foo' do
arch arm: "arm64", intel: "x86" arch arm: "arm64", intel: "x86"
version = '1.2.3' version '1.2.3'
on_mojave :or_later do on_mojave :or_later do
url "https://brew.sh/foo-\#{version}-\#{arch}.pkg" url "https://brew.sh/foo-\#{version}-\#{arch}.pkg"
end end