fix(tsc): guard "No errors found" behind exit code - #3295
Open
NekomyaDev wants to merge 1 commit into
Open
Conversation
…out parseable errors Closes rtk-ai#3220
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.
Closes #3220. (Re-targeted to
developper CONTRIBUTING.md — supersedes #3294.)Problem
TscHandler::format_summaryignored the process exit code: whenever zero parseableTS####errors were captured, it returnedTypeScript: No errors found— even whentscexited non-zero without emitting parseable diagnostics (e.g. missingtsconfig.json, invalid compiler flags, fatal config errors like TS5058). The filter could therefore report success on a failed run.Fix
format_summarynow guards onexit_code:exit_code == 0+ no parseable errors → unchanged:TypeScript: No errors foundexit_code != 0+ no parseable errors → reportsTypeScript: failed (exit code N) with no parseable TS errorsand appends the last 10 non-empty lines of raw output so the fatal diagnostic (which the streaming filter otherwise drops) stays visibleTests
Two new regression tests:
test_tsc_stream_failure_without_parseable_errors— non-zero exit with only a fatal TS5058 line must not contain "No errors found", must surface exit code and the fatal linetest_tsc_stream_success_still_reports_no_errors— zero exit with empty output still reports "No errors found"All existing tsc streaming/filter tests are unaffected (the success path is unchanged).