diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 79985e040c..df9d6aae2f 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -405,6 +405,7 @@ module Cask end def check_missing_verified + return if cask.url.from_block? return if url_includes_file? return if url_match_homepage? return if verified_present? diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index e8922c811b..8a529036b1 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -178,7 +178,7 @@ module Cask set_unique_stanza(:url, args.empty? && options.empty? && !block_given?) do if block_given? - LazyObject.new { URL.new(*yield, caller_location: caller_location) } + LazyObject.new { URL.new(*yield, from_block: true, caller_location: caller_location) } else URL.new(*args, **options, caller_location: caller_location) end diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index 9c6d518479..01b54f1377 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -31,6 +31,7 @@ class URL header: T.nilable(String), user_agent: T.nilable(T.any(Symbol, String)), data: T.nilable(T::Hash[String, String]), + from_block: T::Boolean, caller_location: Thread::Backtrace::Location, ).returns(T.untyped) end @@ -48,6 +49,7 @@ class URL header: nil, user_agent: nil, data: nil, + from_block: false, caller_location: T.must(caller_locations).fetch(0) ) @@ -69,6 +71,7 @@ class URL @specs = specs.compact + @from_block = from_block @caller_location = caller_location end @@ -93,4 +96,9 @@ class URL interpolated_url.exclude?('#{') end + + sig { returns(T::Boolean) } + def from_block? + @from_block + end end