aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/validate.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-06 04:02:24 +0900
committernsfisis <nsfisis@gmail.com>2026-05-06 04:05:13 +0900
commit2bc47940be9359e34cfe50c64fe76234999bc716 (patch)
tree52859450ba8704df79d22917aa132fc5b3a702a6 /crates/mozart/src/commands/validate.rs
parentbf96f8292c0e9818c8b5fc8713ca7506e4338a49 (diff)
downloadphp-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.tar.gz
php-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.tar.zst
php-mozart-2bc47940be9359e34cfe50c64fe76234999bc716.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/validate.rs')
-rw-r--r--crates/mozart/src/commands/validate.rs20
1 files changed, 8 insertions, 12 deletions
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!(
"<info>{name} is valid for simple usage with Composer but has</info>"
));
- console.info(&mozart_core::console::info(
- "strict errors that make it unable to be published as a package",
+ console.info(&console_format!(
+ "<info>strict errors that make it unable to be published as a package</info>"
));
- console.info(&mozart_core::console::warning(
- "See https://getcomposer.org/doc/04-schema.md for details on the schema",
+ console.info(&console_format!(
+ "<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>"
));
} else if result.has_warnings() {
console.info(&console_format!(
"<info>{name} is valid, but with a few warnings</info>"
));
- console.info(&mozart_core::console::warning(
- "See https://getcomposer.org/doc/04-schema.md for details on the schema",
+ console.info(&console_format!(
+ "<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>"
));
} 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!("<warning>{msg}</warning>"));
} else {
console.info(msg);
}