Write text to path as UTF-8 with LF line endings on every platform. Strips any stray \\r before encoding and writes via write_bytes so Python's text-mode translation on Windows can't sneak CRLF in.
(path: Path, text: str)
| 2490 | |
| 2491 | |
| 2492 | def _write_lf(path: Path, text: str) -> None: |
| 2493 | """Write text to path as UTF-8 with LF line endings on every platform. |
| 2494 | Strips any stray \\r before encoding and writes via write_bytes so |
| 2495 | Python's text-mode translation on Windows can't sneak CRLF in.""" |
| 2496 | normalized = text.replace("\r\n", "\n").replace("\r", "\n") |
| 2497 | path.write_bytes(normalized.encode("utf-8")) |
| 2498 | |
| 2499 | |
| 2500 | def _write_report(report_path: Path, flag_only: list[Violation]) -> None: |
no outgoing calls
no test coverage detected