odeprecated: handle deprecated and disabled formulae.

It's not useful to spend time complaining about or fixing deprecations
or disables in deprecated or disabled formulae given we already complain
on install and don't run them through CI.
This commit is contained in:
Mike McQuaid 2020-12-15 12:04:28 +00:00
parent eab2ba852a
commit 4bb8becf60
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -188,9 +188,18 @@ module Kernel
# Don't throw deprecations at all for cached, .brew or .metadata files.
return if backtrace.any? do |line|
line.include?(HOMEBREW_CACHE) ||
line.include?("/.brew/") ||
line.include?("/.metadata/")
next true if line.include?(HOMEBREW_CACHE)
next true if line.include?("/.brew/")
next true if line.include?("/.metadata/")
next false unless line.match?(HOMEBREW_TAP_PATH_REGEX)
path = Pathname(line.split(":", 2).first)
next false unless path.file?
next false unless path.readable?
formula_contents = path.read
formula_contents.include?(" deprecate! ") || formula_contents.include?(" disable! ")
end
tap_message = T.let(nil, T.nilable(String))