validate_actions.cli_components.output_formatter

Output formatter interface and implementations for CLI validation results.

Classes

ColoredFormatter()

Colored console output formatter.

OutputFormatter()

Interface for formatting CLI output.

RichFormatter()

Modern Rich-based formatter with clean, minimalist styling.

class validate_actions.cli_components.output_formatter.OutputFormatter[source]

Bases: ABC

Interface for formatting CLI output.

abstractmethod format_file_header(file)[source]

Format header for a file being validated.

Parameters:

file (Path)

Return type:

str

abstractmethod format_problem(problem)[source]

Format a single problem for display.

Parameters:

problem (Problem)

Return type:

str

abstractmethod format_no_problems()[source]

Format message when no problems found.

Return type:

str

abstractmethod format_summary(total_errors, total_warnings, max_level)[source]

Format final summary of all validation results.

Parameters:
  • total_errors (int)

  • total_warnings (int)

  • max_level (ProblemLevel)

Return type:

str

class validate_actions.cli_components.output_formatter.ColoredFormatter[source]

Bases: OutputFormatter

Colored console output formatter.

Formats CLI output with ANSI color codes and consistent spacing. Used as the default formatter for interactive terminal sessions.

format_file_header(file)[source]

Format file header with underline.

Parameters:

file (Path)

Return type:

str

format_problem(problem)[source]

Format problem with colors and positioning.

Parameters:

problem (Problem)

Return type:

str

format_no_problems()[source]

Format success message when no problems found.

Return type:

str

format_summary(total_errors, total_warnings, max_level)[source]

Format colored summary with counts.

Parameters:
  • total_errors (int)

  • total_warnings (int)

  • max_level (ProblemLevel)

Return type:

str

class validate_actions.cli_components.output_formatter.RichFormatter[source]

Bases: OutputFormatter

Modern Rich-based formatter with clean, minimalist styling.

Features: - Clean typography with subtle colors - Consistent spacing and alignment - Modern icons and visual hierarchy - Responsive layout that works in any terminal width

format_file_header(file)[source]

Format clean file header with modern styling.

Parameters:

file (Path)

Return type:

str

format_problem(problem)[source]

Format problem with clean typography and smart alignment.

Parameters:

problem (Problem)

Return type:

str

format_no_problems()[source]

Format success message with clean styling.

Return type:

str

format_summary(total_errors, total_warnings, max_level)[source]

Format modern summary with visual hierarchy.

Parameters:
  • total_errors (int)

  • total_warnings (int)

  • max_level (ProblemLevel)

Return type:

str