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

Function render_report

atomic-cli/src/commands/triage/mod.rs:353–372  ·  view source on GitHub ↗

The output selection, shared by the routed and the local body: attest > html > json > walkthrough > CLI dashboard.

(
    review: &TriageReview,
    report: &atomic_repository::triage::TriageReport,
)

Source from the content-addressed store, hash-verified

351/// The output selection, shared by the routed and the local body: attest >
352/// html > json > walkthrough > CLI dashboard.
353fn render_report(
354 review: &TriageReview,
355 report: &atomic_repository::triage::TriageReport,
356) -> CliResult<()> {
357 if review.attest {
358 let signed = output::attest_report(report, review.identity.as_deref())?;
359 println!("{}", serde_json::to_string_pretty(&signed).unwrap());
360 } else if review.html {
361 let html = output::render_html(report);
362 write_and_open_html(&html, report, review.output.as_deref(), !review.no_open)?;
363 } else if review.json {
364 println!("{}", serde_json::to_string_pretty(report).unwrap());
365 } else if review.walkthrough {
366 output::print_walkthrough(report);
367 } else {
368 output::print_report(report);
369 }
370
371 Ok(())
372}
373
374/// Resolve the `(source, target)` view pair a triage run operates on.
375///

Callers 1

runMethod · 0.85

Calls 5

attest_reportFunction · 0.85
render_htmlFunction · 0.85
print_walkthroughFunction · 0.85
print_reportFunction · 0.85
write_and_open_htmlFunction · 0.70

Tested by

no test coverage detected