MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / printReport

Function printReport

ts/workflow-cli/cli/validate.ts:60–92  ·  view source on GitHub ↗
(file: string, result: ValidationResult)

Source from the content-addressed store, hash-verified

58}
59
60function printReport(file: string, result: ValidationResult): void {
61 const out = process.stdout;
62
63 if (result.totalErrors === 0 && result.totalWarnings === 0) {
64 out.write(`✓ ${file}: valid\n`);
65 return;
66 }
67
68 out.write(
69 `${file}: ${result.totalErrors} error${pluralize(result.totalErrors)}, ${result.totalWarnings} warning${pluralize(result.totalWarnings)}\n`,
70 );
71
72 for (const canvas of result.canvases) {
73 if (canvas.diagnostics.length === 0) continue;
74 out.write(`\n canvas "${canvas.canvasId}":\n`);
75 for (const d of canvas.diagnostics) printDiagnostic(d, " ");
76 }
77
78 if (result.channelDiagnostics.length > 0) {
79 out.write(`\n channels:\n`);
80 for (const d of result.channelDiagnostics) printDiagnostic(d, " ");
81 }
82
83 if (result.memoryDiagnostics.length > 0) {
84 out.write(`\n memory:\n`);
85 for (const d of result.memoryDiagnostics) printDiagnostic(d, " ");
86 }
87
88 if (result.modelDiagnostics.length > 0) {
89 out.write(`\n models:\n`);
90 for (const d of result.modelDiagnostics) printDiagnostic(d, " ");
91 }
92}
93
94function printDiagnostic(d: Diagnostic, indent: string): void {
95 const where: string[] = [];

Callers 1

validateCommandFunction · 0.85

Calls 3

pluralizeFunction · 0.85
printDiagnosticFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected