Fix 9 bugs: ODT covered-cells, CSV BOM, HTML charset, stderr, dead code

- #13 (critical): Add CoveredTableCell elements to ODT for valid row spans (ODF 1.2)
- #28: Move "Total issues" info message from stdout to stderr (clean pipe output)
- #27: Wrap HTML export in full document with DOCTYPE and meta charset utf-8
- #26: Save CSV with utf-8-sig encoding (UTF-8 BOM for Excel compatibility)
- #31: Document CSV uses full project/version values (not display_* like console/MD)
- #30: Fix ODT header formatting when author is empty (no leading dot/space)
- #36: Remove test_cli_smoke_empty testing unreachable code path (return [])
- #37: Remove unused mock_path variable in ODT test fixture
- #34: Remove unreachable len(parts) != 2 check in parse_date_range

Closes #13, #28, #27, #26, #31, #30, #36, #37, #34
This commit is contained in:
Артём Кокос
2026-06-27 13:01:32 +07:00
parent da069993b9
commit 14219564dd
7 changed files with 158 additions and 28 deletions

View File

@@ -7,7 +7,13 @@ from .base import Formatter
class CSVFormatter(Formatter):
"""Форматтер для экспорта в CSV."""
"""Форматтер для экспорта в CSV.
Использует полные значения project/version (а не display-значения с пустыми
ячейками для групп). Каждая строка CSV самодостаточна — это корректно для
табличного формата (#31). Файл сохраняется в UTF-8 с BOM (utf-8-sig) для
корректного отображения кириллицы в Microsoft Excel (#26).
"""
def __init__(self, **_kwargs):
super().__init__()
@@ -31,5 +37,5 @@ class CSVFormatter(Formatter):
def save(self, rows: List[ReportRow], output_path: str) -> None:
content = self.format(rows)
with open(output_path, "w", encoding="utf-8", newline="") as f:
with open(output_path, "w", encoding="utf-8-sig", newline="") as f:
f.write(content)