audit: Add a global flag to silent warning when auditing
This commit is contained in:
parent
4ec26aea40
commit
d45ff9c0fd
@ -54,6 +54,7 @@ module Homebrew
|
|||||||
|
|
||||||
def audit
|
def audit
|
||||||
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
|
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
|
||||||
|
Homebrew.auditing = true
|
||||||
|
|
||||||
formula_count = 0
|
formula_count = 0
|
||||||
problem_count = 0
|
problem_count = 0
|
||||||
|
@ -45,11 +45,15 @@ module Homebrew
|
|||||||
@failed == true
|
@failed == true
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_writer :raise_deprecation_exceptions
|
attr_writer :raise_deprecation_exceptions, :auditing
|
||||||
|
|
||||||
def raise_deprecation_exceptions?
|
def raise_deprecation_exceptions?
|
||||||
@raise_deprecation_exceptions == true
|
@raise_deprecation_exceptions == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def auditing?
|
||||||
|
@auditing == true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call
|
|||||||
if ARGV.homebrew_developer? || disable ||
|
if ARGV.homebrew_developer? || disable ||
|
||||||
Homebrew.raise_deprecation_exceptions?
|
Homebrew.raise_deprecation_exceptions?
|
||||||
raise MethodDeprecatedError, message
|
raise MethodDeprecatedError, message
|
||||||
else
|
elsif !Homebrew.auditing?
|
||||||
opoo "#{message}\n"
|
opoo "#{message}\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user