install, installed_dependents, uninstall: typed: strict#21173
Merged
MikeMcQuaid merged 4 commits intomainfrom Dec 4, 2025
Merged
install, installed_dependents, uninstall: typed: strict#21173MikeMcQuaid merged 4 commits intomainfrom
typed: strict#21173MikeMcQuaid merged 4 commits intomainfrom
Conversation
typed: stricttyped: strict
Contributor
There was a problem hiding this comment.
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, andinstall.rbfromtyped: truetotyped: 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>
p-linnane
approved these changes
Dec 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew lgtm(style, typechecking and tests) with your changes locally?Part of
typed: strictin all (non-package) files in Homebrew organisation #17297