dev-cmd/audit: fix for Ruby 3

This commit is contained in:
Bo Anderson 2023-10-30 21:21:30 +00:00
parent a339b912c0
commit 3c9eb901db
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -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