From 873b2a00427472673bb1b5fcf92264c3f560c115 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 18 Nov 2020 18:29:20 +0100 Subject: [PATCH 1/2] Fix `brew audit --tap=`. --- Library/Homebrew/dev-cmd/audit.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 4908e738fb..61ed6693bf 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -117,7 +117,12 @@ module Homebrew ENV.setup_build_environment audit_formulae, audit_casks = if args.tap - Tap.fetch(args.tap).formula_names.map { |name| Formula[name] } + Tap.fetch(args.tap).yield_self do |tap| + [ + tap.formula_names.map { |name| Formula[name] }, + tap.cask_files.map { |path| Cask::CaskLoader.load(path) }, + ] + end elsif args.no_named? [Formula, Cask::Cask.to_a] else From 9bfbeace549ae8707d6d27d698c0bdfea059cc0a Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 18 Nov 2020 18:37:53 +0100 Subject: [PATCH 2/2] Fix `corrected_problem_count` and `new_formula_problem_lines`. --- Library/Homebrew/dev-cmd/audit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 61ed6693bf..c7082b7f42 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -193,8 +193,8 @@ module Homebrew formula_count += 1 problem_count += fa.problems.size problem_lines = format_problem_lines(fa.problems) - corrected_problem_count = options[:style_offenses]&.count(&:corrected?) - new_formula_problem_lines = format_problem_lines(fa.new_formula_problems) + corrected_problem_count += options.fetch(:style_offenses, []).count(&:corrected?) + new_formula_problem_lines += format_problem_lines(fa.new_formula_problems) if args.display_filename? puts problem_lines.map { |s| "#{f.path}: #{s}" } else