Skip to content

sorbet: Bump test/support/helper files to typed: true#22469

Merged
issyl0 merged 1 commit into
mainfrom
sorbet-test-helpers
May 30, 2026
Merged

sorbet: Bump test/support/helper files to typed: true#22469
issyl0 merged 1 commit into
mainfrom
sorbet-test-helpers

Conversation

@issyl0
Copy link
Copy Markdown
Member

@issyl0 issyl0 commented May 30, 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? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR.
  • Used GPT-5.3 Codex (Medium reasoning) to add some of the types here. It was not actually particularly helpful and needed a lot of human reviewing and tweaking for less reliance on T.untyped and T.unsafe (particularly Library/Homebrew/test/support/helper/subcommand_spec.rb).

  • Add T.binds for RSpec example groups and matcher test helpers.
  • For the undefined predicate method raising NoMethodError, trick Sorbet into not flagging it as an error by using public_send instead of direct method call - because, correctly, the method does not exist but the test is already verifying that.

Copy link
Copy Markdown
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.

Thanks, looks good when 🟢!

@issyl0
Copy link
Copy Markdown
Member Author

issyl0 commented May 30, 2026

TIL that brew lgtm runs brew tests --changed which despite editing test helpers doesn't in fact run all the tests that those test helpers are used in... adds to list of things to fix.

@issyl0 issyl0 force-pushed the sorbet-test-helpers branch from 814af41 to ff303ca Compare May 30, 2026 14:23
- Add `T.bind`s for RSpec example groups and matcher test helpers.
- For the undefined predicate method raising NoMethodError, trick Sorbet
  into not flagging it as an error by using `public_send` instead of
  direct method call - because, correctly, the method does not exist but
  the test is already verifying that.
@issyl0 issyl0 force-pushed the sorbet-test-helpers branch from ff303ca to 0b1f3c4 Compare May 30, 2026 14:32
@github-code-quality
Copy link
Copy Markdown

github-code-quality Bot commented May 30, 2026

Code Coverage Overview

Languages: Ruby

Ruby / code-coverage/simplecov

The overall coverage in the branch remains at 78%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File 23e5f86 0b1f3c4 +/-
services/system/systemctl.rb 93% 87% -6%
download_queue.rb 74% 73% -1%
dependency.rb 91% 90% -1%
services/cli.rb 61% 63% +2%
services/system.rb 81% 85% +4%

Updated May 30, 2026 14:48 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@issyl0 issyl0 marked this pull request as ready for review May 30, 2026 15:04
Copilot AI review requested due to automatic review settings May 30, 2026 15:04
@issyl0 issyl0 added this pull request to the merge queue May 30, 2026
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Merged via the queue into main with commit 49d2a17 May 30, 2026
38 of 39 checks passed
@issyl0 issyl0 deleted the sorbet-test-helpers branch May 30, 2026 15:22
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