Enable strict typing in Homebrew::TestBot#21506
Conversation
dab44fc to
0484872
Compare
|
You might be able to crib from my PR that did this but that went stale? |
There was a problem hiding this comment.
Pull request overview
This pull request enables strict typing in Homebrew::TestBot by upgrading all module files from typed: true to typed: strict. The changes add comprehensive Sorbet type signatures throughout the TestBot codebase to ensure type safety.
Changes:
- Upgraded all TestBot module files from
typed: truetotyped: strict - Added Sorbet type signatures (
sig) to all methods, attributes, and instance variables - Modified code to satisfy strict typing requirements (e.g., using
T.must(),&., explicit type annotations)
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/test_bot/test_runner.rb | Changed from module_function to class methods, added type aliases and signatures for test runner operations |
| Library/Homebrew/test_bot/test_formulae.rb | Added comprehensive type signatures for formula testing methods and instance variables |
| Library/Homebrew/test_bot/test_cleanup.rb | Added .to_s calls to satisfy strict typing for git command execution |
| Library/Homebrew/test_bot/test.rb | Added type signatures for test class methods and split attr_reader declarations |
| Library/Homebrew/test_bot/tap_syntax.rb | Added type signatures and used T.must() for tap validation |
| Library/Homebrew/test_bot/step.rb | Added comprehensive type signatures for step execution and output handling |
| Library/Homebrew/test_bot/formulae_detect.rb | Added type signatures and T.must() calls for formula detection logic |
| Library/Homebrew/test_bot/formulae_dependents.rb | Added type signatures for dependent formula testing and updated attr_writer declarations |
| Library/Homebrew/test_bot/formulae.rb | Added type signatures for formula building and bottling operations, split attr_writer declarations |
| Library/Homebrew/test_bot/cleanup_before.rb | Added run! method signature for pre-test cleanup |
| Library/Homebrew/test_bot/cleanup_after.rb | Added method signatures for post-test cleanup operations |
| Library/Homebrew/test_bot/bottles_fetch.rb | Added type signatures for bottle fetching operations |
| Library/Homebrew/test_bot.rb | Added module-level method signatures for helper functions |
Files not reviewed (2)
- Library/Homebrew/test_bot/test_formulae.rbi: Language not supported
- Library/Homebrew/test_bot/test_runner.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
054bfbd to
60a7a9d
Compare
60a7a9d to
e266ceb
Compare
d1a1c37 to
3b4bfcf
Compare
3b4bfcf to
82e7e9f
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Looks good so far, my usual T.must hatred aside 😂.
Feel free to self-merge without a rereview (unless you want one!) when 🟢
3d11ca2 to
459f4d4
Compare
459f4d4 to
e6f2b58
Compare
This should fix CI failures caused by #21506 Signed-off-by: botantony <antonsm21@gmail.com>
This should fix CI failures caused by #21506 Signed-off-by: botantony <antonsm21@gmail.com>
|
@botantony @chenrui333 Thanks for the quick action and attention here, will incorporate your observations into the next attempt 🙇 |
brew lgtm(style, typechecking and tests) with your changes locally?I've attempted to annotate the safety of most of the
T.mustinsertions via comments, but happy to refactor as further as reviewers prefer.There are some alignment changes due to the replacement of
module_functionwithclass << selfand the scoping of a bareensurein abeginblock, so viewing the diff with whitespace changes disabled is recommended.I was also able to review the manual rbi shims in this directory as a result of this work.