From f4692ddb4066a6220a7216601633db6f5aaeee9d Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sat, 22 Apr 2023 15:13:35 +0800 Subject: [PATCH] dev-cmd/audit: fix audit annotations Emitting annotations currently produces: Error: no implicit conversion of Symbol into Integer The issue is that `problem` is an `Array` of problems which we need to handle individually. --- Library/Homebrew/dev-cmd/audit.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 02e4893e4b..702b34a926 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -309,16 +309,16 @@ module Homebrew return unless ENV["GITHUB_ACTIONS"] - annotations = formula_results.merge(cask_results).flat_map do |path, problem| - next if problem.blank? - - GitHub::Actions::Annotation.new( - :error, - problem[:message], - file: path, - line: problem[:location]&.line, - column: problem[:location]&.column, - ) + annotations = formula_results.merge(cask_results).flat_map do |path, problems| + problems.map do |problem| + GitHub::Actions::Annotation.new( + :error, + problem[:message], + file: path, + line: problem[:location]&.line, + column: problem[:location]&.column, + ) + end end.compact annotations.each do |annotation|