Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/audit: fix for Ruby 3 #16171

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@
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