//! The report: ONE `snake_case` JSON document every command prints (v1).
//!
//! `validate` fills `findings`/`waived`; `init` fills `written`/`skipped`/
//! `scaffolded`; an abort is `status = "aborted"` with `reason` set. The
//! schema is versioned via `version` so it can evolve without silently
//! breaking consumers.

use crate::types::Report;

/// Serialize a report to its canonical pretty JSON form.
///
/// # Errors
///
/// Returns the `serde_json` serialization error. Unreachable for these types
/// (string keys, no erroring `Serialize` impls) but fallible in the type
/// system.
pub fn render(report: &Report) -> Result<String, serde_json::Error> {
    serde_json::to_string_pretty(report)
}
