From 3c9eb901db8590aeae0e1153c431f319305cade1 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 30 Oct 2023 21:21:30 +0000 Subject: [PATCH] dev-cmd/audit: fix for Ruby 3 --- Library/Homebrew/dev-cmd/audit.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index dd781745c0..6d201ad279 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -345,9 +345,11 @@ module Homebrew end def self.format_problem_lines(problems) - problems.map do |message:, location:, corrected:| - status = " #{Formatter.success("[corrected]")}" if corrected + problems.map do |problem| + status = " #{Formatter.success("[corrected]")}" if problem.fetch(:corrected) + location = problem.fetch(:location) location = "#{location.line&.to_s&.prepend("line ")}#{location.column&.to_s&.prepend(", col ")}: " if location + message = problem.fetch(:message) "* #{location}#{message.chomp.gsub("\n", "\n ")}#{status}" end end