-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
patch: typed: strict
#21289
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
patch: typed: strict
#21289
Conversation
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 the type strictness level from typed: true to typed: strict for the Library/Homebrew/patch.rb file as part of the gradual migration to stricter typing (#17297). The changes add comprehensive Sorbet type signatures throughout the file and remove tests that are no longer applicable due to the type system enforcing constraints that were previously tested manually.
- Added Sorbet type signatures to all methods and instance variables
- Marked
EmbeddedPatchas abstract with proper abstract method declarations - Removed error handling for invalid input types that the type system now prevents
- Removed tests for error cases that are now type-level guarantees and for the abstract
EmbeddedPatchclass that can no longer be instantiated directly
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Library/Homebrew/patch.rb | Upgraded from typed: true to typed: strict, added comprehensive type signatures for methods and instance variables, marked EmbeddedPatch as abstract, and removed runtime error handling for type-level constraints |
| Library/Homebrew/test/patch_spec.rb | Removed tests for runtime type validation errors (now prevented by type system) and removed tests for abstract EmbeddedPatch class instantiation (no longer possible) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
494eead to
e6e65f3
Compare
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.
Looks good so far, thanks!
e6e65f3 to
4616a53
Compare
Signed-off-by: botantony <antonsm21@gmail.com>
Signed-off-by: botantony <antonsm21@gmail.com>
Signed-off-by: botantony <antonsm21@gmail.com>
206f45d to
3c1e992
Compare
d986076 to
b2f767c
Compare
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 @botantony!
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com> Signed-off-by: botantony <antonsm21@gmail.com>
b2f767c to
e0d9334
Compare
brew lgtm(style, typechecking and tests) with your changes locally?Part of #17297