From 2bc47940be9359e34cfe50c64fe76234999bc716 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 6 May 2026 04:02:24 +0900 Subject: refactor(console): rename color helpers and migrate call sites to console_format! The six tag-style color functions (info, comment, error, question, highlight, warning) are pub only so that console_format! can call them from generated code; they are not part of the public API. Rename them to __format_*_message to make that intent visible, add a doc-comment saying not to call them directly, and replace every remaining direct call site with console_format!. Co-Authored-By: Claude Sonnet 4.6 --- crates/mozart/src/commands/validate.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'crates/mozart/src/commands/validate.rs') diff --git a/crates/mozart/src/commands/validate.rs b/crates/mozart/src/commands/validate.rs index 972593f..44e3f5e 100644 --- a/crates/mozart/src/commands/validate.rs +++ b/crates/mozart/src/commands/validate.rs @@ -774,18 +774,18 @@ fn output_result( console.info(&console_format!( "{name} is valid for simple usage with Composer but has" )); - console.info(&mozart_core::console::info( - "strict errors that make it unable to be published as a package", + console.info(&console_format!( + "strict errors that make it unable to be published as a package" )); - console.info(&mozart_core::console::warning( - "See https://getcomposer.org/doc/04-schema.md for details on the schema", + console.info(&console_format!( + "See https://getcomposer.org/doc/04-schema.md for details on the schema" )); } else if result.has_warnings() { console.info(&console_format!( "{name} is valid, but with a few warnings" )); - console.info(&mozart_core::console::warning( - "See https://getcomposer.org/doc/04-schema.md for details on the schema", + console.info(&console_format!( + "See https://getcomposer.org/doc/04-schema.md for details on the schema" )); } else if !lock_errors.is_empty() { let kind = if check_lock { "errors" } else { "warnings" }; @@ -836,16 +836,12 @@ fn output_result( // Print errors for msg in &all_errors { - if msg.starts_with('#') { - console.error(&mozart_core::console::error(msg)); - } else { - console.error(msg); - } + console.error(msg); } for msg in &all_warnings { if msg.starts_with('#') { - console.info(&mozart_core::console::warning(msg)); + console.info(&console_format!("{msg}")); } else { console.info(msg); } -- cgit v1.3.1