"""Read one ``comp.log`` body. M001 and M002 pass the text they already have, from disk or from a git blob. The UVS summary-line format is not known yet, so the counts stay unset. """ from __future__ import annotations from dataclasses import dataclass @dataclass(frozen=True) class CompLogSummary: """Error and warning totals from one compile log. ``None`` means the summary line could not be read. It is not zero. """ error_count: int | None warning_count: int | None def read_comp_log(text: str) -> CompLogSummary: """Return the summary-line error and warning counts in ``text``.""" if not isinstance(text, str): raise TypeError("text must be a string") return CompLogSummary(error_count=None, warning_count=None)