repotoire 0.3.47

Graph-powered code analysis CLI. 81 detectors for security, architecture, and code quality.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! JSON reporter
//!
//! Outputs the full HealthReport as pretty-printed JSON.
//! Useful for machine consumption, piping to jq, or further processing.

use crate::models::HealthReport;
use anyhow::Result;

/// Render report as JSON
pub fn render(report: &HealthReport) -> Result<String> {
    Ok(serde_json::to_string_pretty(report)?)
}

/// Render report as compact JSON (single line)
pub fn render_compact(report: &HealthReport) -> Result<String> {
    Ok(serde_json::to_string(report)?)
}