MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / print_report

Function print_report

atomic-cli/src/commands/triage/output.rs:22–126  ·  view source on GitHub ↗

Render the report to stdout as the bounded human dashboard.

(report: &TriageReport)

Source from the content-addressed store, hash-verified

20
21/// Render the report to stdout as the bounded human dashboard.
22pub fn print_report(report: &TriageReport) {
23 let merkle_short: String = report.inputs.view_merkle.chars().take(8).collect();
24
25 // Verdict banner.
26 let verdict_label = match report.verdict {
27 Verdict::Ready => info("READY").to_string(),
28 Verdict::Blocked => emphasis(crate::output::error("BLOCKED")).to_string(),
29 Verdict::Stale => crate::output::warning("STALE").to_string(),
30 };
31 println!(
32 "{} {} \u{2192} {} {} ({}, {} change{})",
33 emphasis("triage"),
34 report.inputs.feature,
35 report.inputs.target,
36 verdict_label,
37 hint(&format!("merkle {merkle_short}")),
38 report.summary.changes,
39 if report.summary.changes == 1 { "" } else { "s" },
40 );
41
42 // Summary line.
43 println!(
44 " criteria {} met \u{00b7} {} unmet findings {} block \u{00b7} {} warn \u{00b7} {} info",
45 report.summary.criteria_met,
46 report.summary.criteria_unmet,
47 report.summary.findings_block,
48 report.summary.findings_warn,
49 report.summary.findings_info,
50 );
51
52 // Findings (already severity-sorted block → warn → info).
53 if !report.findings.is_empty() {
54 println!("\n{}", emphasis("Findings"));
55 for f in &report.findings {
56 println!(" {}", finding_line(f));
57 }
58 }
59
60 // Per-intent compact view with its criteria as ✓/✗.
61 if !report.intents.is_empty() {
62 println!("\n{}", emphasis("Intents"));
63 for intent in &report.intents {
64 let conform = if intent.conforms {
65 info("conforms").to_string()
66 } else {
67 crate::output::error(format!("{} violation(s)", intent.gate_violations.len()))
68 .to_string()
69 };
70 println!(" {} [{}]", emphasis(&intent.id), conform);
71 if let Some(reviewer) = &intent.reviewed_by {
72 println!(" {}", info(&format!("reviewed by {reviewer}")));
73 }
74 for c in &intent.criteria {
75 let mark = if c.status == "met" {
76 info("\u{2713}").to_string()
77 } else {
78 crate::output::error("\u{2717}").to_string()
79 };

Callers 1

runMethod · 0.85

Calls 7

infoFunction · 0.85
emphasisFunction · 0.85
errorFunction · 0.85
warningFunction · 0.85
hintFunction · 0.85
diff_stat_countsFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected