Show concise TSV rule results without compiler noise - #46879
Merged
Merged
Conversation
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
Copilot started reviewing on behalf of
Timothee Guerin (timotheeguerin)
September 30, 2026 14:29
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The output refactor is coherent and backed by focused unit and end-to-end coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Streamlines TypeSpec Validation output while preserving diagnostics, stale-file checks, and verbose troubleshooting details.
Changes:
- Adds concise rule statuses and final summaries.
- Converts compiler/formatter output into structured diagnostics.
- Adds command color handling and extensive unit/integration coverage.
| File | Description |
|---|---|
.github/shared/src/exec.ts |
Supports command-specific environments. |
.github/shared/test/exec.test.ts |
Tests environment forwarding. |
eng/tools/typespec-validation/README.md |
Documents concise and verbose output. |
eng/tools/typespec-validation/src/command-output.ts |
Classifies and reports command output. |
eng/tools/typespec-validation/src/diagnostics.ts |
Formats statuses, summaries, and output details. |
eng/tools/typespec-validation/src/index.ts |
Aggregates and prints rule results. |
eng/tools/typespec-validation/src/rule-result.ts |
Adds structured multiline diagnostic output. |
eng/tools/typespec-validation/src/rules/compile.ts |
Produces structured compilation diagnostics. |
eng/tools/typespec-validation/src/rules/format.ts |
Produces structured formatting diagnostics. |
eng/tools/typespec-validation/src/utils.ts |
Controls subprocess colors and concise Git reporting. |
eng/tools/typespec-validation/test/cli.test.ts |
Updates CLI output expectations. |
eng/tools/typespec-validation/test/command-output.test.ts |
Covers command-output classification. |
eng/tools/typespec-validation/test/compile.test.ts |
Covers concise compilation behavior. |
eng/tools/typespec-validation/test/compiler-cli.test.ts |
Adds end-to-end CLI coverage. |
eng/tools/typespec-validation/test/diagnostics.test.ts |
Tests summary and status formatting. |
eng/tools/typespec-validation/test/diagnostics.ts |
Includes output in test diagnostic text. |
eng/tools/typespec-validation/test/format.test.ts |
Covers formatter diagnostics and drift. |
eng/tools/typespec-validation/test/generated-files.test.ts |
Tests service-scoped generated-file detection. |
eng/tools/typespec-validation/test/mocks.ts |
Updates mocked Git status data. |
eng/tools/typespec-validation/test/run-node-bin.test.ts |
Tests subprocess color policy. |
eng/tools/typespec-validation/test/run-rules.test.ts |
Tests summaries and verbose statuses. |
eng/tools/typespec-validation/test/util.test.ts |
Updates utility tests for logger-aware Git checks. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Timothee Guerin (timotheeguerin)
marked this pull request as ready for review
September 30, 2026 14:50
Timothee Guerin (timotheeguerin)
requested a review
from a team
as a code owner
September 30, 2026 14:50
Timothee Guerin (timotheeguerin)
merged commit Sep 30, 2026
5df694b
into
main
93 of 104 checks passed
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.
Successful TSV runs still print compiler banners, emitted-file inventories, and Git diagnostics; failed commands can repeat stderr inside a second
Command failedmessage. This is PR 3 of the TSV output cleanup, following #46834.Normal successful single-spec runs print only the final summary, for example
9 passed | 3 skipped. Errors and warnings remain visible. Early failures include a count of rules not run. The single-line summary follows Vitest-style visual hierarchy: green passes, bold red failures, yellow warnings, gray skipped/suppressed/not-run counts, and dim separators. A blank line separates preceding diagnostics or verbose output from the prefix-free summary; quiet successful runs print only that summary. With--verbose, per-rule results use compact checkmarks/crosses (✔ / ×),!for warnings, and labeled dashes for skipped/suppressed rules.Successful compiler/formatter output and inventory/diff details are verbose-only. Native failures preserve their codes, source excerpts, related locations, and colors once. Generated-file and formatting mismatches list affected paths and remediation rather than dumping Git status and full diffs. Unexpected successful command output remains visible.
The stale-Swagger check is unchanged:
--list-filesis still captured internally in quiet mode; only its presentation is debug-only. Compile/Format now return structured diagnostics, completing removal of the legacystdOutput/errorOutputpath. Whole-run batch aggregation and CLI input-error cleanup remain PR 4.Complete single-spec examples
These are actual runs in isolated worktrees, with complete stdout and stderr and no omitted lines. Checkout/Node executable paths are normalized to
<repo>/<node>; ANSI colors are removed for readability. Controlled failure configurations are not included in this PR.Passing spec (47 -> 1 lines)
Compilation and formatting succeed without file drift. The only output is the final rule summary.
Focused output diff (timing differences ignored)
Before — complete stdout and stderr
After — complete stdout and stderr
Native compiler failure (23 -> 16 lines)
The fixture selects nonexistent autorest
version: "1900-01-01". Native diagnostic details remain visible, followed by the summary.Focused output diff (timing differences ignored)
Before — complete stdout and stderr
After — complete stdout and stderr
Formatting mismatch (64 -> 5 lines)
The fixture commits extra spaces after
default:in tspconfig.yaml. Formatting corrects the spacing and TSV still exits 1 with the affected file, fix command, and summary.Focused output diff (timing differences ignored)
Before — complete stdout and stderr
After — complete stdout and stderr
Add
--verbose(or use a CI debug rerun) for compact per-rule indicators and detailed execution logs.NO_COLOR/FORCE_COLORcontrols also apply to captured subprocesses, without mutating the parent environment.Repository template selector (this is tooling-only, not an API or SDK configuration change)
Choose a PR Template
Switch to "Preview" on this description then select one of the choices below.
Click here to open a PR for a Data Plane API.
Click here to open a PR for a Control Plane (ARM) API.
Click here to open a PR for only SDK configuration.