From 55e86125a6797f9c8c3d7a81d3d37a1ae20f3cde Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Tue, 3 Nov 2020 14:38:44 -0500 Subject: [PATCH] audit: don't fail if exception list doesn't exist --- Library/Homebrew/dev-cmd/audit.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 4568fc39c9..d5dcd16821 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -816,7 +816,7 @@ module Homebrew stable_url_minor_version = stable_url_version.minor.to_i formula_suffix = stable.version.patch.to_i - throttled_rate = @audit_exceptions["THROTTLED_FORMULAE"][formula.name] + throttled_rate = audit_exception_list("THROTTLED_FORMULAE")[formula.name] if throttled_rate && formula_suffix.modulo(throttled_rate).nonzero? problem "should only be updated every #{throttled_rate} releases on multiples of #{throttled_rate}" end @@ -1024,6 +1024,14 @@ module Homebrew def head_only?(formula) formula.head && formula.stable.nil? end + + def audit_exception_list(list) + if @audit_exceptions.key? list + @audit_exceptions[list] + else + {} + end + end end class ResourceAuditor