diff options
| author | Gautham Goli | 2017-09-02 12:38:18 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-09-04 23:57:09 +0530 |
| commit | d45ff9c0fdfa834c55c01f9c95fe18064fabd76a (patch) | |
| tree | f3d4a7ad2af0169e798db49b25f44c0a93dbe2f5 | |
| parent | 4ec26aea4025d19e70cdf59da6dfd7be3a389e44 (diff) | |
| download | brew-d45ff9c0fdfa834c55c01f9c95fe18064fabd76a.tar.bz2 | |
audit: Add a global flag to silent warning when auditing
| -rw-r--r-- | Library/Homebrew/dev-cmd/audit.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/global.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/utils.rb | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 1f8acb1b9..884861c87 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -54,6 +54,7 @@ module Homebrew def audit Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D" + Homebrew.auditing = true formula_count = 0 problem_count = 0 diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb index 9f79781b4..32b5377a0 100644 --- a/Library/Homebrew/global.rb +++ b/Library/Homebrew/global.rb @@ -45,11 +45,15 @@ module Homebrew @failed == true end - attr_writer :raise_deprecation_exceptions + attr_writer :raise_deprecation_exceptions, :auditing def raise_deprecation_exceptions? @raise_deprecation_exceptions == true end + + def auditing? + @auditing == true + end end end diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index e3137ac49..07e339576 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -102,7 +102,7 @@ def odeprecated(method, replacement = nil, disable: false, disable_on: nil, call if ARGV.homebrew_developer? || disable || Homebrew.raise_deprecation_exceptions? raise MethodDeprecatedError, message - else + elsif !Homebrew.auditing? opoo "#{message}\n" end end |
