-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
install, installed_dependents, uninstall: typed: strict
#21173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
typed: stricttyped: strict
There was a problem hiding this 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, 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>
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again!
brew lgtm(style, typechecking and tests) with your changes locally?Part of
typed: strictin all (non-package) files in Homebrew organisation #17297