-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
cask/dsl: typed: strict
#21371
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
cask/dsl: typed: strict
#21371
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 three cask DSL files from typed: true to typed: strict Sorbet type checking, adding comprehensive type annotations to satisfy stricter type requirements.
- Adds explicit type signatures for methods and instance variables across version, depends_on, and container DSL classes
- Converts implicit type inference to explicit T.let declarations for constants and instance variables
- Fixes a potential bug in
invalid_charactersmethod by adding explicit.to_sconversion
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Library/Homebrew/cask/dsl/version.rb | Upgraded to strict typing with method signatures, T.let for DIVIDERS constant, and explicit type conversions |
| Library/Homebrew/cask/dsl/depends_on.rb | Upgraded to strict typing with detailed method signatures, converted attr_readers to methods with lazy initialization, and T.let annotations |
| Library/Homebrew/cask/dsl/container.rb | Upgraded to strict typing with method signatures and T.let annotations for instance variables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7c329ea to
09c12b3
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 thanks @botantony!
17b7516 to
151867c
Compare
brew lgtm(style, typechecking and tests) with your changes locally?Part of #17297