Skip to content

Align upgrade summary columns#22844

Open
paulogdm wants to merge 8 commits into
Homebrew:mainfrom
paulogdm:paulogdm/upgrade-preview-columns
Open

Align upgrade summary columns#22844
paulogdm wants to merge 8 commits into
Homebrew:mainfrom
paulogdm:paulogdm/upgrade-preview-columns

Conversation

@paulogdm

@paulogdm paulogdm commented Jun 21, 2026

Copy link
Copy Markdown

Hello team,

Small QoL update, as I was running brew upgrade and 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:

    deno 2.7.10 -> 2.7.11
    codex 0.117.0 -> 0.118.0

After:

    deno   2.7.10  -> 2.7.11
    codex  0.117.0 -> 0.118.0

Open Questions

  • Would this change cause other lists in the program to look 'different', which may be undesired? If the answer is yes, feel free to close.
  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • A: Not a bug fix, but you can reproduce this improvement by having several outdated packages and then brew upgrade --dry-run.
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

A: 🤖 Used Codex with GPT 5.5.

@paulogdm paulogdm force-pushed the paulogdm/upgrade-preview-columns branch from 37db75c to c655e71 Compare June 21, 2026 19:47
@paulogdm paulogdm marked this pull request as ready for review June 21, 2026 19:56
Copilot AI review requested due to automatic review settings June 21, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_summary to 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.

Comment thread Library/Homebrew/cmd/upgrade.rb
@paulogdm paulogdm force-pushed the paulogdm/upgrade-preview-columns branch from c655e71 to 07abac6 Compare June 21, 2026 20:15
@paulogdm paulogdm force-pushed the paulogdm/upgrade-preview-columns branch from 07abac6 to 1376ed1 Compare June 21, 2026 20:56

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! Some code cleanup and this should be good to go.

Comment on lines +4 to +7
module Homebrew
module UpgradeSummary
sig { params(upgrades: T::Array[String]).returns(T::Array[String]) }
def self.format(upgrades)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this warrants a new module: just put it as a new method in Library/Homebrew/upgrade.rb

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that. Will patch tonight.

Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
Comment thread Library/Homebrew/upgrade_summary.rb Outdated
paulogdm and others added 7 commits June 22, 2026 12:49
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>
@paulogdm

Copy link
Copy Markdown
Author

Will do a small cleanup and some patching tonight, and then mark as "ready for review".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants