From 8d4f6a4222b9228b97b965034feba78c4c4d6bcd Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 23:36:16 +0900 Subject: fix(licenses): use 4-space JSON indentation to match Composer Composer outputs JSON with 4-space indentation. Mozart was using serde_json::to_string_pretty which defaults to 2-space. Switch to a custom PrettyFormatter with explicit 4-space indent. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/licenses.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'crates/mozart/src') diff --git a/crates/mozart/src/commands/licenses.rs b/crates/mozart/src/commands/licenses.rs index 161b20a..577d0b5 100644 --- a/crates/mozart/src/commands/licenses.rs +++ b/crates/mozart/src/commands/licenses.rs @@ -1,4 +1,5 @@ use clap::Args; +use serde::Serialize; use std::collections::HashSet; use std::path::{Path, PathBuf}; @@ -276,7 +277,11 @@ fn render_json( "dependencies": dependencies, }); - println!("{}", serde_json::to_string_pretty(&output)?); + let buf = Vec::new(); + let formatter = serde_json::ser::PrettyFormatter::with_indent(b" "); + let mut ser = serde_json::Serializer::with_formatter(buf, formatter); + output.serialize(&mut ser)?; + println!("{}", String::from_utf8(ser.into_inner())?); Ok(()) } -- cgit v1.3.1