audit: use name tap_audit_exceptions

This commit is contained in:
Rylan Polster 2020-11-04 23:42:42 -05:00
parent 55e86125a6
commit e1f463ff26

View File

@ -127,15 +127,15 @@ module Homebrew
audit_formulae.sort.each do |f|
only = only_cops ? ["style"] : args.only
options = {
new_formula: new_formula,
strict: strict,
online: online,
git: git,
only: only,
except: args.except,
spdx_license_data: spdx_license_data,
spdx_exception_data: spdx_exception_data,
audit_exceptions: f.tap.audit_exceptions,
new_formula: new_formula,
strict: strict,
online: online,
git: git,
only: only,
except: args.except,
spdx_license_data: spdx_license_data,
spdx_exception_data: spdx_exception_data,
tap_audit_exceptions: f.tap.audit_exceptions,
}
options[:style_offenses] = style_offenses.for_path(f.path) if style_offenses
options[:display_cop_names] = args.display_cop_names?
@ -248,7 +248,7 @@ module Homebrew
@specs = %w[stable head].map { |s| formula.send(s) }.compact
@spdx_license_data = options[:spdx_license_data]
@spdx_exception_data = options[:spdx_exception_data]
@audit_exceptions = options[:audit_exceptions]
@tap_audit_exceptions = options[:tap_audit_exceptions]
end
def audit_style
@ -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_exception_list("THROTTLED_FORMULAE")[formula.name]
throttled_rate = tap_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
@ -1025,9 +1025,9 @@ module Homebrew
formula.head && formula.stable.nil?
end
def audit_exception_list(list)
if @audit_exceptions.key? list
@audit_exceptions[list]
def tap_audit_exception_list(list)
if @tap_audit_exceptions.key? list
@tap_audit_exceptions[list]
else
{}
end