Merge pull request #16171 from Bo98/audit-fix
dev-cmd/audit: fix for Ruby 3
This commit is contained in:
commit
abc0eec904
@ -345,9 +345,11 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.format_problem_lines(problems)
|
def self.format_problem_lines(problems)
|
||||||
problems.map do |message:, location:, corrected:|
|
problems.map do |problem|
|
||||||
status = " #{Formatter.success("[corrected]")}" if corrected
|
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
|
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}"
|
"* #{location}#{message.chomp.gsub("\n", "\n ")}#{status}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user