Skip to content

Commit 0279c3d

Browse files
author
Dominikus Nold
committed
Fix type annotations
1 parent 58fb2c6 commit 0279c3d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/pr-orchestrator.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ jobs:
219219
- name: Run type checking
220220
run: |
221221
echo "🔍 Running basedpyright type checking..."
222-
hatch run type-check || echo "⚠️ Type checking incomplete"
222+
# Fail on type errors (severity 8) to enforce type safety in CI/CD
223+
hatch run type-check
223224
224225
linting:
225226
name: Linting (ruff, pylint)

src/specfact_cli/commands/import_cmd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from __future__ import annotations
99

1010
from pathlib import Path
11+
from typing import Optional
1112

1213
import typer
1314
from beartype import beartype
@@ -277,7 +278,7 @@ def from_code(
277278
"--entry-point",
278279
help="Subdirectory path for partial analysis (relative to repo root). Analyzes only files within this directory and subdirectories.",
279280
),
280-
output_format: StructuredFormat | None = typer.Option(
281+
output_format: Optional[StructuredFormat] = typer.Option(
281282
None,
282283
"--output-format",
283284
help="Plan bundle output format (yaml or json). Defaults to global --output-format.",

src/specfact_cli/commands/plan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from contextlib import suppress
1212
from datetime import UTC
1313
from pathlib import Path
14-
from typing import Any
14+
from typing import Any, Optional
1515

1616
import typer
1717
from beartype import beartype
@@ -68,7 +68,7 @@ def init(
6868
"--scaffold/--no-scaffold",
6969
help="Create complete .specfact directory structure",
7070
),
71-
output_format: StructuredFormat | None = typer.Option(
71+
output_format: Optional[StructuredFormat] = typer.Option(
7272
None,
7373
"--output-format",
7474
help="Plan bundle format for output (yaml or json). Defaults to global --output-format.",

src/specfact_cli/utils/structured_io.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
Provides helpers to load and dump JSON/YAML consistently with format detection.
55
"""
66

7-
from __future__ import annotations
8-
97
import json
108
from enum import Enum
119
from pathlib import Path
12-
from typing import Any
10+
from typing import Any, Optional
1311

1412
from beartype import beartype
1513
from icontract import ensure, require
@@ -28,7 +26,7 @@ def __str__(self) -> str: # pragma: no cover - convenience
2826

2927
@classmethod
3028
@beartype
31-
def from_string(cls, value: str | None, default: StructuredFormat | None = None) -> StructuredFormat:
29+
def from_string(cls, value: str | None, default: Optional["StructuredFormat"] = None) -> "StructuredFormat":
3230
"""
3331
Convert string to StructuredFormat (defaults to YAML).
3432
@@ -45,7 +43,7 @@ def from_string(cls, value: str | None, default: StructuredFormat | None = None)
4543

4644
@classmethod
4745
@beartype
48-
def from_path(cls, path: Path | str | None, default: StructuredFormat | None = None) -> StructuredFormat:
46+
def from_path(cls, path: Path | str | None, default: Optional["StructuredFormat"] = None) -> "StructuredFormat":
4947
"""
5048
Infer format from file path suffix.
5149

0 commit comments

Comments
 (0)