diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-06 04:02:24 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-06 04:05:13 +0900 |
| commit | 2bc47940be9359e34cfe50c64fe76234999bc716 (patch) | |
| tree | 52859450ba8704df79d22917aa132fc5b3a702a6 /crates/mozart/src/commands/audit.rs | |
| parent | bf96f8292c0e9818c8b5fc8713ca7506e4338a49 (diff) | |
| download | php-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/audit.rs')
| -rw-r--r-- | crates/mozart/src/commands/audit.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/crates/mozart/src/commands/audit.rs b/crates/mozart/src/commands/audit.rs index f9da344..5c0d46c 100644 --- a/crates/mozart/src/commands/audit.rs +++ b/crates/mozart/src/commands/audit.rs @@ -1,4 +1,5 @@ use clap::Args; +use mozart_core::console_format; use mozart_core::console_writeln; use mozart_core::console_writeln_error; use mozart_registry::packagist::SecurityAdvisory; @@ -376,9 +377,8 @@ fn detect_abandoned(packages: &[PackageEntry]) -> Vec<AbandonedPackage> { fn render_table(result: &AuditResult, console: &mozart_core::console::Console) { if result.total_advisory_count == 0 && result.abandoned.is_empty() { - console.info(&format!( - "{}", - mozart_core::console::info("No security vulnerability advisories found.") + console.info(&console_format!( + "<info>No security vulnerability advisories found.</info>" )); return; } @@ -393,10 +393,7 @@ fn render_table(result: &AuditResult, console: &mozart_core::console::Console) { "Found {} security vulnerability {} affecting {} package(s):", result.total_advisory_count, advisory_word, result.affected_package_count ); - console_writeln_error!( - console, - &format!("{}", mozart_core::console::highlight(&header)), - ); + console_writeln_error!(console, &console_format!("<highlight>{header}</highlight>"),); console_writeln_error!(console, ""); for advisories in result.advisories.values() { @@ -450,10 +447,7 @@ fn render_table(result: &AuditResult, console: &mozart_core::console::Console) { if !result.abandoned.is_empty() { let header = format!("Found {} abandoned package(s):", result.abandoned.len()); - console_writeln_error!( - console, - &format!("{}", mozart_core::console::highlight(&header)), - ); + console_writeln_error!(console, &console_format!("<highlight>{header}</highlight>"),); console_writeln_error!(console, ""); let name_width = 20usize; |
