patch: `typed: strict` by botantony · Pull Request #21289 · Homebrew/brew
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.