Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Dec 16, 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?

Part of

Copilot AI review requested due to automatic review settings December 16, 2025 01:48
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 migrates the keg.rb and related files to Sorbet's typed: strict mode by adding comprehensive type signatures and making necessary adjustments for type safety. This is part of a broader effort (#17297) to improve type checking across the Homebrew codebase.

Key Changes

  • Upgraded from typed: true to typed: strict in keg.rb and extend/os/mac/keg.rb
  • Added Sorbet type signatures (sig) to all methods in the Keg class and related classes
  • Enhanced type safety by adding explicit type annotations to instance variables and memoized class variables using T.let

Reviewed changes

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

File Description
Library/Homebrew/keg.rb Upgraded to typed: strict and added comprehensive type signatures to all methods, error classes, and instance variables
Library/Homebrew/keg_relocate.rb Converted Pathname argument to String for codesign_patched_binary call to match type signature
Library/Homebrew/extend/os/mac/keg.rb Upgraded to typed: strict and added type signatures to ClassMethods and instance methods
Library/Homebrew/extend/os/mac/keg_relocate.rb Converted Pathname arguments to String for codesign_patched_binary calls to match type signature

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

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.

Looks great, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit 1e9701e Dec 16, 2025
43 checks passed
@MikeMcQuaid MikeMcQuaid deleted the keg-strict-type branch December 16, 2025 08:54
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