topmark.presentation.text.diagnostic¶
topmark / presentation / text / diagnostic
TEXT diagnostic rendering helpers for CLI commands.
This module contains helpers that render diagnostics for human-facing TEXT output formats. These generate no I/O.
render_human_diagnostics_text ¶
Render prepared human diagnostics as text for human output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
counts
|
HumanDiagnosticCounts
|
Aggregated human-facing diagnostic counts. |
required |
diagnostics
|
list[HumanDiagnosticLine]
|
Prepared human-facing diagnostic lines. |
required |
verbosity_level
|
int
|
Effective verbosity for gating extra details. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Text document as single string. |
Source code in src/topmark/presentation/text/diagnostic.py
render_diagnostics_text ¶
Render diagnostics as text for human output.
Behavior
- If there are no diagnostics, do nothing.
- At verbosity 0, emit a single triage line with a hint to use
-v. - At verbosity >= 1, emit a summary line and then one line per diagnostic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diagnostics
|
FrozenDiagnosticLog | MutableDiagnosticLog
|
An immutable or mutable diagnostic log. |
required |
verbosity_level
|
int
|
Effective verbosity level. |
required |
color
|
bool
|
Render in color if True, as plain text otherwise. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Text document as single string. |