Skip to content

Commit

Permalink
dev-cmd/audit: fix for Ruby 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Oct 30, 2023
1 parent a339b91 commit 3c9eb90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,11 @@ def self.print_problems(results, display_filename:)
end

def self.format_problem_lines(problems)
problems.map do |message:, location:, corrected:|
status = " #{Formatter.success("[corrected]")}" if corrected
problems.map do |problem|

Check warning on line 348 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L348

Added line #L348 was not covered by tests
status = " #{Formatter.success("[corrected]")}" if problem.fetch(:corrected)
location = problem.fetch(:location)

Check warning on line 350 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L350

Added line #L350 was not covered by tests
location = "#{location.line&.to_s&.prepend("line ")}#{location.column&.to_s&.prepend(", col ")}: " if location
message = problem.fetch(:message)

Check warning on line 352 in Library/Homebrew/dev-cmd/audit.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/audit.rb#L352

Added line #L352 was not covered by tests
"* #{location}#{message.chomp.gsub("\n", "\n ")}#{status}"
end
end
Expand Down

0 comments on commit 3c9eb90

Please sign in to comment.