Draft
Conversation
Moves `Library/Homebrew/sorbet/` to `sorbet/` at the project root so that Sorbet's LSP server can auto-discover the config and rbi shims without needing to be started from `Library/Homebrew/`. This addresses sorbet/sorbet#9808, where the LSP server silently skips RBI shim files when the working directory doesn't contain a `sorbet/` subdirectory. Updates `sorbet/config` to pass `--dir=Library/Homebrew` explicitly so Sorbet still type-checks the right source tree. Adjusts `typecheck.rb` to `cd` to `HOMEBREW_REPOSITORY` (project root) instead of `HOMEBREW_LIBRARY_PATH`, and adds a `with_env("TMPDIR" => ...)` guard to prevent a Sorbet SIGSEGV caused by Homebrew's build TMPDIR. Also adds `sorbet/.rubocop.yml` inheriting from `Library/.rubocop.yml` so the moved tapioca compiler files continue to receive the standard Homebrew RuboCop configuration, and updates path references in `Library/.rubocop.yml` and the CI workflows accordingly.
Auto-corrected by `brew style --fix --changed`: - Use `%w[]` word arrays in constants - Prefer `exclude?` over `!include?` - Also applies the config changes from the previous commit
After moving sorbet/ to the project root, `require_relative "../../../global"` in compilers three levels deep now resolves to the project root rather than Library/Homebrew/. Update all relative paths to include the Library/Homebrew/ segment, and replace `require "sorbet/tapioca/utils"` (which relied on Library/Homebrew being in $LOAD_PATH) with `require_relative "../utils"`.
Library/.rubocop.yml should not reference paths outside Library/ via `..`. Move the AllCops/Exclude for auto-generated RBI files and the Homebrew/NegateInclude Exclude for tapioca compilers into sorbet/.rubocop.yml, where paths are naturally relative to the sorbet/ directory.
- `style.rb`: include `sorbet/` in the default full scan alongside `Library/Homebrew/`, so `brew style` without arguments catches violations in tapioca compiler files. - `config_spec.rb`: fix the relative path to `sorbet/tapioca/config.yml` (now five levels up from the test file rather than three).
Member
Author
|
No need to review/merge at this time, as it doesn't resolve the LSP navigation issues. I'm keeping this open for visibility & discussion with the sorbet folks, though feel free to close if it's annoying/distracting to have an open unactionable PR. |
The Sorbet LSP requires a single --dir input; having both --dir=Library/Homebrew and --dir=sorbet/rbi crashes the server. Using --dir=. also segfaults due to the volume of files scanned. Keep sorbet/config and sorbet/tapioca/ at the project root (so the LSP can discover the config), but move the auto-generated RBI shims back under Library/Homebrew/sorbet/rbi/ so a single --dir=Library/Homebrew satisfies both the CLI typechecker and the LSP. Update all references: rubocop configs, typecheck.rb, workflows, and docs.
MikeMcQuaid
approved these changes
May 8, 2026
Member
MikeMcQuaid
left a comment
There was a problem hiding this comment.
I would be OK with this if it fixes the issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Library/Homebrew/sorbet/→sorbet/at the project root to address sorbet/sorbet#9808, where Sorbet's LSP server silently skips RBI shim files whensorbet/is not a direct subdirectory of the working directory (the project root in editor setups).sorbet/configto pass--dir=Library/Homebrewexplicitly sosrb tcstill type-checks the right source tree from the project root.brew typechecktocdtoHOMEBREW_REPOSITORY(project root) instead ofHOMEBREW_LIBRARY_PATH, and adds awith_env("TMPDIR" => ...)guard to prevent a Sorbet SIGSEGV caused by Homebrew's buildTMPDIR(/private/tmp).sorbet/.rubocop.ymlinheriting fromLibrary/.rubocop.ymlso the moved tapioca compiler files continue to receive the standard Homebrew RuboCop configuration.Library/.rubocop.yml,.gitignore, and CI workflows accordingly.Caveats
This is an inherently disruptive change — it renames ~290 files and touches CI,
.gitignore, and rubocop config. Even if it resolves the LSP issues described in sorbet/sorbet#9808, it may not be desirable. In particular:ruby-lsp) starting from the project root to confirm that RBI shims are now picked up correctly.brew typecheck --updateruns tapioca from the project root. The tapioca config and compilers reference paths relative toLibrary/Homebrew/; these have been verified to work, but deserve extra scrutiny.--changedstyle checks now span two config domains. A newsorbet/.rubocop.ymlbridges this, but it's an additional config file to maintain.Test plan
brew lgtm --onlinepasses (style, typecheck, tests)brew typecheck --updatestill regenerates RBI files correctlybrew lgtm(style, typechecking and tests) with your changes locally?TMPDIR, identify the correct--dirand--ignorepath semantics, and fix RuboCop config inheritance for the moved files. All changes were reviewed andbrew lgtm --onlinewas run to verify correctness.