Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Dec 4, 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 4, 2025 01:07
@cho-m cho-m changed the title install installed_dependents uninstall: typed: strict install, installed_dependents, uninstall: typed: strict Dec 4, 2025
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 upgrades several Ruby files to use Sorbet's typed: strict mode as part of the ongoing effort to improve type safety in the Homebrew codebase. The changes primarily involve adding proper type signatures (sig blocks) to methods and adding type annotations to instance variables and attributes.

  • Converts uninstall.rb, installed_dependents.rb, and install.rb from typed: true to typed: strict
  • Adds comprehensive method signatures with proper parameter and return types
  • Adds type annotations to attributes and instance variables to satisfy strict mode requirements

Reviewed changes

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

Show a summary per file
File Description
Library/Homebrew/uninstall.rb Upgraded to typed: strict and added signatures for uninstall_kegs, handle_unsatisfied_dependents, check_for_dependents!, and rm_pin methods
Library/Homebrew/keg_relocate.rb Added T.must(first) to handle potential nil from array destructuring in replace_text_in_files
Library/Homebrew/keg.rb Added type annotations to attr_reader declarations for name (String) and path, linked_keg_record, opt_record (Pathname), plus signature for rack method
Library/Homebrew/installed_dependents.rb Upgraded to typed: strict and added signature for find_some_installed_dependents with proper nilable tuple return type
Library/Homebrew/install.rb Upgraded to typed: strict, added type annotations to instance variables using T.let, and added signature for print_dry_run_dependencies (though with an incorrect block return type)
Library/Homebrew/extend/os/mac/keg.rb Changed from File.lchmod to file.lchmod for stylistic consistency

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 again!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 4, 2025
Merged via the queue into main with commit aed4919 Dec 4, 2025
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the uninstall-typed branch December 4, 2025 10:51
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.

4 participants