(
export_dir: Path, rows: list[CommitRow]
)
| 601 | |
| 602 | |
| 603 | def write_category_exports( |
| 604 | export_dir: Path, rows: list[CommitRow] |
| 605 | ) -> list[Path]: |
| 606 | export_dir.mkdir(parents=True, exist_ok=True) |
| 607 | written_files: list[Path] = [] |
| 608 | categories = ordered_values((row.category for row in rows), PR_CATEGORIES) |
| 609 | for category in categories: |
| 610 | category_rows = [row for row in rows if row.category == category] |
| 611 | if not category_rows: |
| 612 | continue |
| 613 | category_name = category_output_name(category) |
| 614 | category_dir = export_dir / category_name |
| 615 | markdown_path = category_dir / f'result_{category_name}.md' |
| 616 | csv_path = category_dir / f'result_{category_name}.csv' |
| 617 | markdown_path.parent.mkdir(parents=True, exist_ok=True) |
| 618 | markdown_path.write_text( |
| 619 | render_category_markdown(category, category_rows) |
| 620 | ) |
| 621 | write_csv(csv_path, category_rows) |
| 622 | written_files.extend([markdown_path, csv_path]) |
| 623 | return written_files |
| 624 | |
| 625 | |
| 626 | def parse_args() -> argparse.Namespace: |
no test coverage detected