Preserve Sorbet warnings in formatted srb output#971
Merged
Conversation
Capture leading Sorbet stderr lines while parsing typecheck output so formatted `spoom srb tc` and `spoom srb bump` output no longer drops warnings emitted before errors. Assisted-By: devx/eb25d669-b4ee-4e28-9b69-129b45e1e178
Morriar
reviewed
Jul 8, 2026
Comment on lines
+59
to
+63
| # Used when only Sorbet errors are needed and leading stderr warnings can be ignored. | ||
| #: (String output, ?error_url_base: String) -> Array[Error] | ||
| def parse_string(output, error_url_base: DEFAULT_ERROR_URL_BASE) | ||
| parse_result(output, error_url_base: error_url_base).errors | ||
| end |
Contributor
There was a problem hiding this comment.
Can't we just change this one to return a ParseResult?
Contributor
Author
There was a problem hiding this comment.
That's what I had initially but Tapioca uses parse_string in here. Which I had to execute during https://github.com/Shopify/spoom/blob/main/bin/export-rbi. So I went with a new function instead to be backwards compatible and ship this easier.
Comment on lines
81
to
+85
| #: (String output) -> Array[Error] | ||
| def parse(output) | ||
| parse_result(output).errors | ||
| end | ||
|
|
Contributor
There was a problem hiding this comment.
Same here, let's just return a ParseResult directly?
Contributor
Author
There was a problem hiding this comment.
We could although it's public API and would break callers if there are any
Morriar
approved these changes
Jul 8, 2026
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.
Capture leading Sorbet stderr lines while parsing typecheck output so formatted
spoom srb tcandspoom srb bumpoutput no longer drops warnings emitted before errors.I initially changed the existing
parse_stringfunction but it's an API used by Tapioca, opted for a new function instead.