Configure template target cells and add skip-errors mode

This commit is contained in:
Rob committed 2026-04-21 16:12:49 +02:00
1 parent 418d8336f5
commit 5f3a820641
5 files changed
+31 -17

No files matched your search

+6 -2
View File
@@ -53,7 +53,8 @@ def _print_preview(month: int, year: int, matched_assignments: list, planned_fil
@click.option("--month", type=click.IntRange(1, 12), required=True)
@click.option("--year", type=click.IntRange(2000, 2100), required=True)
@click.option("--yes", is_flag=True, default=False, help="Skip interactive confirmation.")
def main(month: int, year: int, yes: bool) -> None:
@click.option("--skip-errors", is_flag=True, default=False, help="Generate files for matched records, skip unresolved ones.")
def main(month: int, year: int, yes: bool, skip_errors: bool) -> None:
configure_logging()
project_root = Path(__file__).resolve().parent
@@ -99,8 +100,11 @@ def main(month: int, year: int, yes: bool) -> None:
_print_issues(business_issues, "=== Business validation ===")
all_issues = [*match_issues, *business_issues]
if any(issue.severity == "error" for issue in all_issues):
has_errors = any(issue.severity == "error" for issue in all_issues)
if has_errors and not skip_errors:
raise click.ClickException("Validation failed after matching.")
if has_errors and skip_errors:
click.echo("Warnhinweis: Fehler vorhanden. Weiterfahrt mit --skip-errors (nur gematchte Faelle werden erzeugt).")
filename_pattern = config["output"]["filename_pattern"]
unique_employees = sorted({item.allocation.employee_name for item in matched_assignments})