Merge pull request #9542 from MikeMcQuaid/odeprecated-deprecate-disable

odeprecated: handle deprecated and disabled formulae.
This commit is contained in:
Mike McQuaid 2020-12-15 13:06:54 +00:00 committed by GitHub
commit 34b9fe1338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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))