Skip to content

sorbet: Bump more OS-specific tests to higher typed levels - #23575

Merged
MikeMcQuaid merged 1 commit into
sorbet-cask-two-errorsfrom
sorbet-os-two-errors
Aug 20, 2026
Merged

sorbet: Bump more OS-specific tests to higher typed levels#23575
MikeMcQuaid merged 1 commit into
sorbet-cask-two-errorsfrom
sorbet-os-two-errors

Conversation

@issyl0

@issyl0 issyl0 commented Aug 19, 2026

Copy link
Copy Markdown
Member

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Code CLI, Claude Opus 5 (High reasoning, Ultracode was too intense 🤯), with human prompting, review and tweaks.


  • Part of my ongoing quest to bump all the test files to at least Sorbet typed: true, because that's a thing we can do.
  • In a 🥞 gh stack because I wanted to try them out on a real chain of changes.
  • See the commit message body for the full description of the changes.

@issyl0
issyl0 force-pushed the sorbet-os-two-errors branch from edde7e6 to d9aaef5 Compare August 19, 2026 21:44
@issyl0
issyl0 force-pushed the sorbet-os-two-errors branch from d9aaef5 to a287dcd Compare August 19, 2026 21:45
@issyl0
issyl0 marked this pull request as ready for review August 19, 2026 22:17
Copilot AI lite review requested due to automatic review settings August 19, 2026 22:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 increases Sorbet type coverage in OS-specific RSpec tests by bumping selected spec files from typed: false to typed: true, ensuring these tests typecheck under stricter settings.

Changes:

  • Promote Library/Homebrew/test/os/mac/ffi/native_library_spec.rb to typed: true and adjust the test module’s singleton method definition to satisfy Sorbet typing (via T.bind and define_singleton_method).
  • Promote Library/Homebrew/test/os/linux/ld_spec.rb to typed: true and refactor the temporary directory setup from a captured local variable to an RSpec let.
Show a summary per file
File Description
Library/Homebrew/test/os/mac/ffi/native_library_spec.rb Raises Sorbet strictness for the macOS FFI native library spec and updates method definition/binding for typechecking.
Library/Homebrew/test/os/linux/ld_spec.rb Raises Sorbet strictness for the Linux ld spec and modernises tmpdir setup using let.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@issyl0
issyl0 marked this pull request as draft August 19, 2026 22:31
- Define the temporary ld.so configuration directory as an RSpec let
  so setup, examples and cleanup share a non-nil Pathname.

- Bind the anonymous native-library module after extending it, and use
  a singleton-method block that preserves the extended receiver type.
@issyl0
issyl0 force-pushed the sorbet-os-two-errors branch from a287dcd to 642ed21 Compare August 19, 2026 23:29
@MikeMcQuaid
MikeMcQuaid marked this pull request as ready for review August 20, 2026 07:40
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 20, 2026
Merged via the queue into main with commit 1989f92 Aug 20, 2026
45 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the sorbet-os-two-errors branch September 1, 2026 16:15
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