From b4d4f6d50422107ef79c5b976bed891915d5ef2e Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Fri, 6 Nov 2020 12:33:28 -0500 Subject: [PATCH] audit: require JSON arrays/objects for audit exceptions --- Library/Homebrew/dev-cmd/audit.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index a5147b35a8..eedf24df54 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -1207,6 +1207,14 @@ module Homebrew def audit_tap_audit_exceptions @tap_audit_exceptions.each do |list_name, formula_names| + unless [Hash, Array].include? formula_names.class + problem <<~EOS + audit_exceptions/#{list_name}.json should contain a JSON array + of formula names or a JSON object mapping formula names to values + EOS + next + end + formula_names = formula_names.keys if formula_names.is_a? Hash invalid_formulae = []