Load the checked-in baseline as a counted set of signature keys.
(path: Path = DEFAULT_BASELINE)
| 114 | |
| 115 | |
| 116 | def load_baseline(path: Path = DEFAULT_BASELINE) -> Counter[str]: |
| 117 | """Load the checked-in baseline as a counted set of signature keys.""" |
| 118 | baseline: Counter[str] = Counter() |
| 119 | if not path.exists(): |
| 120 | return baseline |
| 121 | for raw_line in path.read_text(encoding="utf-8").splitlines(): |
| 122 | line = raw_line.strip() |
| 123 | if not line or line.startswith("#"): |
| 124 | continue |
| 125 | baseline[line] += 1 |
| 126 | return baseline |
| 127 | |
| 128 | |
| 129 | def write_baseline(hits: list[NoexceptHit], path: Path = DEFAULT_BASELINE) -> None: |
no test coverage detected