- **Current state:** Diagnostic formatting is scattered across three locations: - `Diagnostic.__str__` - `CompileResult.format_diagnostics` - `CheckResult.format_diagnostics` - `_format_diagnostics_with_label` (in runner) - **Long-term goal:** - Implement a "common formatter" utility in the `diagnostics` module (e.g., `format_diagnostics(diagnostics: list[Diagnostic])`). - Separate responsibilities so that the `runner` focuses solely on "how to prepend labels," while the common utility handles the core formatting.
Diagnostic.__str__CompileResult.format_diagnosticsCheckResult.format_diagnostics_format_diagnostics_with_label(in runner)diagnosticsmodule (e.g.,format_diagnostics(diagnostics: list[Diagnostic])).runnerfocuses solely on "how to prepend labels," while the common utility handles the core formatting.