Skip to content

Commit 516f99c

Browse files
fix: resolve Ruff lint errors (F821, B008, I001, UP045)
1 parent dd94f2d commit 516f99c

6 files changed

Lines changed: 6 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ line-length = 120
5555

5656
[tool.ruff.lint]
5757
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
58-
ignore = ["E501"]
58+
ignore = ["E501", "B008"]
5959

6060
[tool.ruff.lint.isort]
6161
known-first-party = ["*"]

src/api_contract_guardian/cli.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
from __future__ import annotations
44

55
import json
6-
from pathlib import Path
7-
86
import typer
7+
from pathlib import Path
98
from rich.console import Console
109
from rich.table import Table
1110

@@ -18,7 +17,7 @@ def require_license(product: str) -> None: # type: ignore[misc]
1817
pass
1918

2019
from .diff import DiffResult, diff_specs
21-
from .gate import GateResult, check_gate
20+
from .gate import check_gate
2221
from .loader import SpecLoadError, load_spec, validate_openapi_version
2322
from .migration import generate_migration_guide, generate_migration_guide_json
2423

@@ -85,7 +84,7 @@ def _print_result(result: DiffResult) -> None:
8584
def diff(
8685
old: str = typer.Argument(..., help="Path to old (baseline) OpenAPI spec"),
8786
new: str = typer.Argument(..., help="Path to new (proposed) OpenAPI spec"),
88-
output: Optional[str] = typer.Option(None, "--output", "-o", help="Output file path"),
87+
output: str | None = typer.Option(None, "--output", "-o", help="Output file path"),
8988
format: str = typer.Option("rich", "--format", "-f", help="Output format: rich, json, markdown"),
9089
) -> None:
9190
"""Compare two OpenAPI specs and show all detected changes."""
@@ -125,7 +124,7 @@ def check(
125124
fail_on_dangerous: bool = typer.Option(False, "--fail-on-dangerous/--allow-dangerous", help="Fail on dangerous changes"),
126125
max_breaking: int = typer.Option(0, "--max-breaking", help="Max allowed breaking changes (default 0)"),
127126
max_dangerous: int = typer.Option(-1, "--max-dangerous", help="Max allowed dangerous changes (-1=unlimited)"),
128-
output: Optional[str] = typer.Option(None, "--output", "-o", help="Output file path"),
127+
output: str | None = typer.Option(None, "--output", "-o", help="Output file path"),
129128
) -> None:
130129
"""Gate CI pipeline on breaking changes. Returns exit code 1 if gate fails."""
131130
require_license("api-contract-guardian")
@@ -164,7 +163,7 @@ def check(
164163
def migrate(
165164
old: str = typer.Argument(..., help="Path to old (baseline) OpenAPI spec"),
166165
new: str = typer.Argument(..., help="Path to new (proposed) OpenAPI spec"),
167-
output: Optional[str] = typer.Option(None, "--output", "-o", help="Output file path"),
166+
output: str | None = typer.Option(None, "--output", "-o", help="Output file path"),
168167
format: str = typer.Option("markdown", "--format", "-f", help="Output format: markdown, json"),
169168
) -> None:
170169
"""Generate a migration guide between two OpenAPI spec versions."""
12 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.
12 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)