Skip to content

sorbet: enable experimental RSpec mode#21742

Merged
dduugg merged 1 commit intomainfrom
sorbet-enable-experimental-rspec
Mar 15, 2026
Merged

sorbet: enable experimental RSpec mode#21742
dduugg merged 1 commit intomainfrom
sorbet-enable-experimental-rspec

Conversation

@dduugg
Copy link
Copy Markdown
Member

@dduugg dduugg commented Mar 15, 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?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Claude Code was used to draft the commit message and PR description. The changes themselves were authored by the human. The diff was reviewed manually before committing.


Adds --enable-experimental-rspec to the Sorbet config so that Sorbet type-checks RSpec spec files. This is an isolated piece of #21690, separated so that the follow-up work of dialling up the typed: level of individual specs can land independently.

Enabling the flag surfaced a pre-existing type error in formula-analytics/pycall-setup.rbi where InfluxDBClient3#initialize was incorrectly declared as a singleton method (def self.initialize) rather than an instance method (def initialize).

No new tests are needed — the change is to Sorbet configuration and an RBI stub file; correctness is verified by brew typecheck passing.

Add `--enable-experimental-rspec` to the Sorbet config so that Sorbet
type-checks RSpec spec files. This is an isolated piece of the work in
#21690, separated so that the follow-up work of dialling up the `typed:`
level of individual specs can land independently.

Enabling the flag surfaced a pre-existing type error in
`formula-analytics/pycall-setup.rbi` where `InfluxDBClient3#initialize`
was incorrectly declared as a singleton method (`def self.initialize`)
rather than an instance method (`def initialize`). Fixed here since the
error is only visible with RSpec mode enabled.
@dduugg dduugg force-pushed the sorbet-enable-experimental-rspec branch from 81a09e7 to 8384332 Compare March 15, 2026 19:59
@dduugg dduugg marked this pull request as ready for review March 15, 2026 20:00
Copilot AI review requested due to automatic review settings March 15, 2026 20:00
@dduugg dduugg enabled auto-merge March 15, 2026 20:00
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.

Pull request overview

Enables Sorbet’s experimental RSpec support so RSpec specs can be type-checked with improved DSL awareness, and fixes a related RBI signature issue discovered by the stricter checking.

Changes:

  • Add --enable-experimental-rspec to the Sorbet typechecker config.
  • Fix InfluxDBClient3#initialize in an RBI stub to be an instance method rather than a singleton method.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
Library/Homebrew/sorbet/config Enables Sorbet’s experimental RSpec mode during srb tc.
Library/Homebrew/formula-analytics/pycall-setup.rbi Corrects InfluxDBClient3#initialize stub to match Ruby semantics (instance initializer).
Files not reviewed (1)
  • Library/Homebrew/formula-analytics/pycall-setup.rbi: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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!

@dduugg dduugg added this pull request to the merge queue Mar 15, 2026
Merged via the queue into main with commit 198639f Mar 15, 2026
44 checks passed
@dduugg dduugg deleted the sorbet-enable-experimental-rspec branch March 15, 2026 20:47
issyl0 added a commit that referenced this pull request Mar 29, 2026
- Now that we've enabled `--experimental-rspec-mode` [1], let's start
  using Sorbet in tests at its basic `typed: false` level for now.
- This will ease the migration to `typed: true` of any or all tests we
  want to do in the future.

[1]: #21742
@issyl0 issyl0 mentioned this pull request Mar 29, 2026
6 tasks
issyl0 added a commit that referenced this pull request Mar 29, 2026
- Now that we've enabled `--experimental-rspec-mode` [1], let's start
  using Sorbet in tests at its basic `typed: false` level for now.
- This will ease the migration to `typed: true` of any or all tests we
  want to do in the future.

[1]: #21742
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