join multiple skip messages and improve output formatting#21707
Closed
rexmhall09 wants to merge 1 commit into
Closed
join multiple skip messages and improve output formatting#21707rexmhall09 wants to merge 1 commit into
rexmhall09 wants to merge 1 commit into
Conversation
Join multiple skip messages with ", " and print the combined string instead of only the first message. Update output formatting for both skipped and non-skipped statuses and add a test to verify multiple messages are displayed (e.g. "Not maintained, Archived upstream").
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves livecheck skip output by displaying all skip reasons when multiple apply, and updates the printing logic/tests to match.
Changes:
- Join multiple skip
messageswith", "inSkipConditions.print_skip_information. - Update printed output for statuses that include a
messagesarray (both skipped and non-skipped). - Add an RSpec example verifying multiple skip messages are displayed together.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Library/Homebrew/livecheck/skip_conditions.rb |
Joins :messages arrays and prints the combined message instead of only the first entry. |
Library/Homebrew/test/livecheck/skip_conditions_spec.rb |
Adds coverage for printing multiple skip messages in one line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+328
to
333
| messages = skip_hash[:messages].join(", ") | ||
| if skip_hash[:status] == "skipped" | ||
| puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{skip_hash[:messages][0]}" | ||
| puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{messages}" | ||
| else | ||
| puts "#{Tty.red}#{name}#{Tty.reset}: #{skip_hash[:messages][0]}" | ||
| puts "#{Tty.red}#{name}#{Tty.reset}: #{messages}" | ||
| end |
There was a problem hiding this comment.
print_skip_information now joins multiple entries in :messages for both skipped and non-skipped statuses, but the spec only covers the status == "skipped" branch. Please add a test case where status is something else (e.g. "error") with multiple messages to exercise the else branch and prevent regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Join multiple skip messages with ", " instead of displaying only the first
message. This ensures all skip reasons are shown when multiple apply
(e.g. "Not maintained, Archived upstream").
Also update the output formatting for both skipped and non-skipped
statuses to improve consistency.
A test was added to verify that multiple skip messages are joined and
displayed correctly.
brew lgtmwith your changes locally?Codex was used to help speed up implementing the change and drafting the
update. The code and tests were manually reviewed and verified locally,
and
brew lgtmwas run to ensure all checks pass (on my machine).