Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Nov 27, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Updating a couple of these based on Sorbet docs:

Copilot AI review requested due to automatic review settings November 27, 2025 01:20
Copy link
Contributor

Copilot AI left a comment

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 updates type signatures for == methods across the codebase to use T.anything instead of T.untyped or more specific type annotations, following the official Sorbet documentation recommendations. The changes improve type safety while maintaining backward compatibility.

  • Updated type signatures from T.untyped or specific types to T.anything for equality comparison methods
  • Refactored implementations in PyPI::Package and BumpVersionParser to use case statements with explicit type handling
  • Ensured consistent pattern for equality methods across the codebase

Reviewed changes

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

File Description
Library/Homebrew/version.rb Updated == signature from T.untyped to T.anything
Library/Homebrew/utils/pypi.rb Updated == signature to T.anything and refactored implementation to use case statement for safer type handling
Library/Homebrew/checksum.rb Updated == signature from T.any(String, Checksum, Symbol) to T.anything (implementation already handles types correctly)
Library/Homebrew/bump_version_parser.rb Updated == signature from T.untyped to T.anything and refactored implementation to use case statement

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

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Nice! It's a shame rubocop-sorbet doesn't have a check for this tbh (or maybe it does, I haven't looked 🤷)

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 27, 2025
Merged via the queue into main with commit 585ff58 Nov 27, 2025
41 checks passed
@MikeMcQuaid MikeMcQuaid deleted the sorbet-equals branch November 27, 2025 10:40
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.

5 participants