Align upgrade summary columns#22844
Conversation
37db75c to
c655e71
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves the readability of brew upgrade output by aligning the “name” and “installed version” columns across multi-item upgrade summaries, making the list easier to scan.
Changes:
- Added
Cask::Upgrade.format_upgrade_summaryto column-align upgrade summary lines for multi-item lists. - Applied the formatter to cask upgrade summaries and the final combined upgrade summary.
- Updated/added RSpec expectations to cover the new aligned output.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/cmd/upgrade.rb | Formats the final upgrade summary using the new aligned formatter. |
| Library/Homebrew/cask/upgrade.rb | Implements aligned formatting and uses it when printing cask upgrade summaries. |
| Library/Homebrew/test/cmd/upgrade_spec.rb | Updates expected brew upgrade output spacing for aligned columns. |
| Library/Homebrew/test/cask/upgrade_spec.rb | Adds unit coverage for the new formatter across mixed upgrade line shapes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c655e71 to
07abac6
Compare
07abac6 to
1376ed1
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Good idea! Some code cleanup and this should be good to go.
| module Homebrew | ||
| module UpgradeSummary | ||
| sig { params(upgrades: T::Array[String]).returns(T::Array[String]) } | ||
| def self.format(upgrades) |
There was a problem hiding this comment.
Don't think this warrants a new module: just put it as a new method in Library/Homebrew/upgrade.rb
There was a problem hiding this comment.
Roger that. Will patch tonight.
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
|
Will do a small cleanup and some patching tonight, and then mark as "ready for review". |
Hello team,
Small QoL update, as I was running
brew upgradeand it was difficult to scan through all the packages without a more human friendly formatting. This change aligns package names and installed versions using calculated column widths (✅ formula, ✅ casks, and ✅ combined upgrade summaries -- single-package output is unchanged):Before:
After:
Open Questions
brewcommands to reproduce the bug?brew upgrade --dry-run.brew lgtm(style, typechecking and tests) locally?A: 🤖 Used Codex with GPT 5.5.