(hits: list[NoexceptHit])
| 306 | |
| 307 | |
| 308 | def _print_hits(hits: list[NoexceptHit]) -> None: |
| 309 | by_file: dict[str, list[NoexceptHit]] = {} |
| 310 | for hit in hits: |
| 311 | by_file.setdefault(hit.path, []).append(hit) |
| 312 | |
| 313 | for filepath in sorted(by_file): |
| 314 | print(f"{filepath}:") |
| 315 | for hit in sorted(by_file[filepath], key=lambda item: item.line): |
| 316 | print(f" Line {hit.line}: {hit.line_text}") |
| 317 | print() |
| 318 | |
| 319 | |
| 320 | def main() -> int: |