MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / appendFixTargetLines

Function appendFixTargetLines

src/commands/test.ts:8260–8274  ·  view source on GitHub ↗

* Render a `recommendedFixTarget` value in text mode. Shared by * `renderResultText` (under `--include-analysis`), * `renderFailureContextText`, and `renderFailureSummaryText` so the * three surfaces format the field identically. * * `null` (M2.1 visibility policy) renders as "— (analysis pipel

(lines: string[], fix: CliFixTarget | null, label: string)

Source from the content-addressed store, hash-verified

8258 * reference and indented rationale.
8259 */
8260function appendFixTargetLines(lines: string[], fix: CliFixTarget | null, label: string): void {
8261 if (fix === null) {
8262 lines.push(`${label}— (analysis pipeline did not propose one)`);
8263 return;
8264 }
8265 const ref = fix.reference ? ` reference=${fix.reference}` : '';
8266 lines.push(`${label}kind=${fix.kind}${ref}`);
8267 if (fix.rationale !== null) {
8268 // Indent the rationale to the column under the value. The exact
8269 // column doesn't have to match the label width across surfaces;
8270 // a fixed two-space hanging indent keeps the rendering local to
8271 // this helper so callers don't pad themselves.
8272 lines.push(` ${fix.rationale}`);
8273 }
8274}
8275
8276/**
8277 * §5.2 / M2.1 piece 3 — text renderer for `test failure summary`.

Callers 3

renderFailureContextTextFunction · 0.85
renderResultTextFunction · 0.85
renderFailureSummaryTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected