Skip to main content

sniff/
reporter_render.rs

1use crate::config::ResolvedConfig;
2use crate::report_types::RunReport;
3
4use super::cost::calculate_cost;
5use super::markdown::write_markdown_report;
6use super::summary::print_summary;
7
8pub fn render_report(
9    run_report: &RunReport,
10    config: &ResolvedConfig,
11    out: Option<&str>,
12) -> Result<(), String> {
13    let cost_str = calculate_cost(&run_report.stats, config);
14
15    if let Some(out_path) = out {
16        write_markdown_report(run_report, out_path, &cost_str)?;
17    }
18
19    print_summary(&run_report.stats, &run_report.file_verdicts, &cost_str, out);
20    Ok(())
21}