Skip to main content

Module format

Module format 

Source
Expand description

Shared output formatting utilities (color, verbosity, bar charts, etc.). Shared output formatting utilities for CLI reports.

All colored output flows through this module so that NO_COLOR support and verbosity filtering are centralised in one place.

§Color Policy

The NO_COLOR environment variable disables all color output when set (to any value). Check once at startup via color_enabled() and pass the result through to the formatting helpers.

§Verbosity Levels

Three levels control how much output the user sees:

LevelErrorsWarningsSummaryFindingsVerbose details
Quietyesnofinalnono
Defaultyesyesyeskeyno
Verboseyesyesyesallyes

Enums§

ConfidenceTier
Confidence tier for display purposes.
Verbosity
CLI output verbosity level.

Functions§

color_enabled
Returns true if colored output is enabled.
format_bar_chart
Format a horizontal bar chart entry.
format_bordered_box
Format text inside a bordered box using box-drawing characters.
format_copy_block
Format a “copy this” block — content framed by horizontal rules but with no vertical border characters, so the user can select and paste the content directly without stripping symbols.
format_error_hint
Format an error message with optional hint lines.
format_human_size
Format a byte count as a human-readable size.
format_info
Format an info message: info: {message}.
format_number
Format a number with thousands separators.
format_section_header
Format a section header using box-drawing characters.
format_tier_bullet
Format a confidence tier bullet.
format_warn
Format a warning message: warn: {message}.
styled_tier_bullet
Return the colored bullet string for a confidence tier.
tier_bullet_char
Return the bullet character for a confidence tier.