fix(founding-wizard): mypy/ruff cleanup for CI
CI / detect-changes (push) Successful in 10s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / validate-canonical-controls (push) Successful in 14s
CI / loc-budget (push) Successful in 17s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Successful in 42s
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped

- markdown_to_docx.py: type annotations + unused import
- founding_wizard_routes.py: drop unused get_db import
This commit is contained in:
Benjamin Admin
2026-05-20 09:58:38 +02:00
parent 39c39b1254
commit 4478b7f479
2 changed files with 5 additions and 6 deletions
@@ -19,7 +19,6 @@ from pydantic import BaseModel
from sqlalchemy import text from sqlalchemy import text
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from classroom_engine.database import get_db
from compliance.services.founding_wizard import ( from compliance.services.founding_wizard import (
base_context, base_context,
markdown_to_docx_bytes, markdown_to_docx_bytes,
@@ -16,10 +16,10 @@ from __future__ import annotations
import io import io
import re import re
from typing import Optional from typing import Any, Optional
from docx import Document from docx import Document
from docx.shared import Pt, RGBColor from docx.shared import Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.text import WD_ALIGN_PARAGRAPH
HEADING_RE = re.compile(r"^(#{1,5})\s+(.+)$") HEADING_RE = re.compile(r"^(#{1,5})\s+(.+)$")
@@ -34,7 +34,7 @@ INLINE_ITALIC = re.compile(r"(?<!\*)\*(?!\*)([^*]+)\*(?!\*)|_([^_]+)_")
INLINE_CODE = re.compile(r"`([^`]+)`") INLINE_CODE = re.compile(r"`([^`]+)`")
def _add_runs(paragraph, text: str) -> None: def _add_runs(paragraph: Any, text: str) -> None:
"""Parse inline-Formatierung und fuege Runs hinzu.""" """Parse inline-Formatierung und fuege Runs hinzu."""
pos = 0 pos = 0
tokens: list[tuple[str, str]] = [] tokens: list[tuple[str, str]] = []
@@ -54,7 +54,7 @@ def _add_runs(paragraph, text: str) -> None:
tokens.append(("bold", first.group(1))) tokens.append(("bold", first.group(1)))
elif first is m_code: elif first is m_code:
tokens.append(("code", first.group(1))) tokens.append(("code", first.group(1)))
else: elif m_italic is not None:
content = m_italic.group(1) or m_italic.group(2) content = m_italic.group(1) or m_italic.group(2)
tokens.append(("italic", content)) tokens.append(("italic", content))
pos = first.end() pos = first.end()
@@ -87,7 +87,7 @@ def _parse_table(lines: list[str], start: int) -> tuple[list[list[str]], int]:
return rows, i return rows, i
def _add_table(doc: Document, rows: list[list[str]]) -> None: def _add_table(doc: Any, rows: list[list[str]]) -> None:
if not rows: if not rows:
return return
ncols = max(len(r) for r in rows) ncols = max(len(r) for r in rows)