Skip to content

Enable strict typing in Homebrew::TestBot#21506

Open
dduugg wants to merge 2 commits intomainfrom
test-bot-strict-typing
Open

Enable strict typing in Homebrew::TestBot#21506
dduugg wants to merge 2 commits intomainfrom
test-bot-strict-typing

Conversation

@dduugg
Copy link
Member

@dduugg dduugg commented Feb 2, 2026

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

I've attempted to annotate the safety of most of the T.must insertions via comments, but happy to refactor as further as reviewers prefer.

There are some alignment changes due to the replacement of module_function with class << self and the scoping of a bare ensure in a begin block, 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.

@dduugg dduugg force-pushed the test-bot-strict-typing branch 4 times, most recently from dab44fc to 0484872 Compare February 2, 2026 20:34
@issyl0
Copy link
Member

issyl0 commented Feb 2, 2026

You might be able to crib from my PR that did this but that went stale?

@dduugg dduugg marked this pull request as ready for review February 2, 2026 20:45
Copilot AI review requested due to automatic review settings February 2, 2026 20:45
Copy link
Contributor

Copilot AI left a 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 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: true to typed: 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.

@dduugg dduugg force-pushed the test-bot-strict-typing branch from 054bfbd to 60a7a9d Compare February 2, 2026 21:02
@dduugg dduugg marked this pull request as draft February 2, 2026 21:02
@dduugg dduugg force-pushed the test-bot-strict-typing branch from 60a7a9d to e266ceb Compare February 2, 2026 21:09
@dduugg dduugg marked this pull request as ready for review February 2, 2026 21:23
@dduugg dduugg force-pushed the test-bot-strict-typing branch 17 times, most recently from d1a1c37 to 3b4bfcf Compare February 5, 2026 03:18
@dduugg dduugg force-pushed the test-bot-strict-typing branch from 3b4bfcf to 82e7e9f Compare February 5, 2026 03:34
@dduugg dduugg changed the title [WIP] Enable strict typing in Homebrew::TestBot Enable strict typing in Homebrew::TestBot Feb 5, 2026
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a 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, my usual T.must hatred aside 😂.

Feel free to self-merge without a rereview (unless you want one!) when 🟢

@dduugg dduugg force-pushed the test-bot-strict-typing branch from 3c0d8c3 to 3d11ca2 Compare February 5, 2026 14:30
@dduugg dduugg force-pushed the test-bot-strict-typing branch from 3d11ca2 to 459f4d4 Compare February 5, 2026 14:32
@dduugg dduugg enabled auto-merge February 5, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants