🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

bundle: narrow types#22799

Merged
MikeMcQuaid merged 2 commits into
mainfrom
bundle-types
Jun 18, 2026
Merged

bundle: narrow types#22799
MikeMcQuaid merged 2 commits into
mainfrom
bundle-types

Conversation

@cho-m

@cho-m cho-m commented Jun 18, 2026

Copy link
Copy Markdown
Member

  • 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?
  • 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.

Updates some Object usage to more specific types. Some changes include:

  • Change exit_early_check to return String errors so that it has the same return signature as full_check
  • Make CheckResult into a T::Struct for better type checking
  • entries consist of Dsl::Entry which avoids having to T.cast

This allows Sorbet to follow types better.

Some usage of Object needs to remain due to odd inheritance hacks we have for different "packages". Will require a refactor to get rid of these.

Copilot AI review requested due to automatic review settings June 18, 2026 17:04

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 tightens Sorbet typing across brew bundle’s checking logic by replacing broad Object usage with more specific types (notably Dsl::Entry) and by standardizing check outputs as arrays of error strings. This improves type inference through the bundle checker pipeline and reduces the need for explicit casts.

Changes:

  • Standardize check/find_actionable return types to T::Array[String] (error messages), including making exit_early_check produce the same kind of output as full_check.
  • Convert Homebrew::Bundle::Checker::CheckResult from an untyped Struct to a typed T::Struct.
  • Narrow many entries parameters from T::Array[Object] to T::Array[Dsl::Entry], removing redundant T.cast usage.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Library/Homebrew/bundle/tap.rb Narrows entries typing for tap checks to Dsl::Entry.
Library/Homebrew/bundle/package_type.rb Standardizes check output to string errors and narrows entries typing.
Library/Homebrew/bundle/extensions/winget.rb Narrows entries typing in format_checkable.
Library/Homebrew/bundle/extensions/uv.rb Narrows entries typing in format_checkable.
Library/Homebrew/bundle/extensions/mac_app_store.rb Narrows entries typing; updates early-exit check to return string errors.
Library/Homebrew/bundle/extensions/flatpak.rb Narrows entries typing and removes casts.
Library/Homebrew/bundle/extensions/extension.rb Narrows entries typing and standardizes check return type to string errors.
Library/Homebrew/bundle/checker.rb Introduces typed CheckResult and narrows all checker error arrays to String.
Library/Homebrew/bundle/brew.rb Narrows entries typing and standardizes actionable results as string errors.
Library/Homebrew/bundle/brew_services.rb Narrows entries typing in format_checkable.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/bundle/package_type.rb
Comment thread Library/Homebrew/bundle/extensions/mac_app_store.rb Outdated

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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread Library/Homebrew/bundle/package_type.rb
Updates some Object usage to more specific types. Some changes include:

- Change `exit_early_check` to return String errors so that it has the
  same return signature as `full_check`
- Make `CheckResult` into a `T::Struct` for better type checking
- `entries` consist of `Dsl::Entry` which avoids having to `T.cast`

@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.

Nice cleanup!

@MikeMcQuaid MikeMcQuaid enabled auto-merge June 18, 2026 18:22

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Comment thread Library/Homebrew/bundle/package_type.rb
Comment thread Library/Homebrew/bundle/dsl.rb

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 18, 2026
Merged via the queue into main with commit 14af9a9 Jun 18, 2026
41 of 42 checks passed
@MikeMcQuaid MikeMcQuaid deleted the bundle-types branch June 18, 2026 19:32
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