Improve cleanup ask output#22416
Open
MikeMcQuaid wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines how cleanup “dry-run” output is produced and displayed during upgrade planning (brew upgrade --ask) and brew bundle cleanup, aiming to reduce noisy/duplicated headings and make formatting consistent by reusing cleanup logic in-process.
Changes:
- Adjust
Homebrew::Upgrade.upgrade_formulaeto avoid per-formula install-cleanup previews during dry runs and instead print a single aggregated dry-run cleanup section. - Add
Homebrew::Cleanup.dry_run_outputandprinted_dry_run_output?helpers to capture and print dry-run cleanup output consistently. - Update
brew bundle cleanupto reuseCleanupdry-run output formatting (and avoid shelling out for dry-run cleanup), with corresponding spec updates.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Library/Homebrew/upgrade.rb |
Prints one aggregated dry-run cleanup section after a dry-run upgrade pass. |
Library/Homebrew/cleanup.rb |
Adds helpers to capture cleanup dry-run output and print standardized headings. |
Library/Homebrew/bundle/subcommand/cleanup.rb |
Uses Cleanup helpers for dry-run cleanup output instead of shelling out. |
Library/Homebrew/test/cmd/upgrade_spec.rb |
Adds coverage ensuring dry-run cleanup output is sourced from a single named run. |
Library/Homebrew/test/cmd/bundle/cleanup_subcommand_spec.rb |
Updates expectations to reflect in-process cleanup dry-run output formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Avoid noisy command previews during `brew upgrade --ask`. - Share one dry-run cleanup heading across formulae. - Get upgrade cleanup output from one formula-only dry run. - Reuse bundle cleanup output formatting for consistency. - Avoid shelling out for bundle cleanup dry runs. - Reuse `Cleanup#cleanup_formula` so dry runs show removals. - Skip empty cleanup headings when there is no work.
258e1dc to
5f2fa12
Compare
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.
brew upgrade --ask.Cleanup#cleanup_formulaso dry runs show removals.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing.