reporter
reporter
¶
Validation output formatting and reporting.
Provides formatted output for validation results, supporting both terminal display with Rich and JSON output for tooling.
Attributes¶
Classes¶
ValidationIssueDict
¶
Bases: TypedDict
Typed schema for serialized ValidationIssue entries in JSON output.
Required keys: check_id, severity, message (always present). Optional keys are only included when the source ValidationIssue has them set.
ValidationReporter
¶
Formats and outputs validation results.
Supports multiple output formats: - Terminal output with colors (default) - JSON for machine parsing - Plain text for logs
Initialize reporter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
console
|
Console | None
|
Rich Console for output. Creates one if not provided. |
None
|
Source code in src/marianne/validation/reporter.py
Functions¶
report_terminal
¶
Output validation results to terminal with formatting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issues
|
list[ValidationIssue]
|
List of validation issues |
required |
config_name
|
str
|
Name of the config being validated |
required |
show_passed
|
bool
|
Whether to show passed checks summary |
True
|
Source code in src/marianne/validation/reporter.py
report_json
¶
Output validation results as JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issues
|
list[ValidationIssue]
|
List of validation issues |
required |
Returns:
| Type | Description |
|---|---|
str
|
JSON string representation |
Source code in src/marianne/validation/reporter.py
report_rendering_terminal
¶
Output a rendering preview to the terminal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preview
|
RenderingPreview
|
The rendering preview to display. |
required |
verbose
|
bool
|
If False, show sheet 1 only. If True, show all sheets. |
False
|
Source code in src/marianne/validation/reporter.py
report_rendering_json
¶
Return a rendering preview as a JSON-serializable dict.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
preview
|
RenderingPreview
|
The rendering preview to serialize. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with total_sheets, has_fan_out, has_dependencies, |
dict[str, Any]
|
render_errors, and a sheets array. |
Source code in src/marianne/validation/reporter.py
format_plain
¶
Format issues as plain text for logs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issues
|
list[ValidationIssue]
|
List of validation issues |
required |
Returns:
| Type | Description |
|---|---|
str
|
Plain text representation |