Skip to content

Commit 3fd5946

Browse files
Fix: Ruff linting config for FastAPI compatibility
- Add B008 to ignore (Depends() in defaults is standard FastAPI pattern) - Add S106 to ignore (false positive for token_type strings) - Add TYPE_CHECKING import for ContentService to fix F821
1 parent 132ed3f commit 3fd5946

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/api/deps.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""API dependencies."""
22
from collections.abc import AsyncGenerator
3-
from typing import Annotated
3+
from typing import TYPE_CHECKING, Annotated
4+
5+
if TYPE_CHECKING:
6+
from app.services.content import ContentService
47

58
from fastapi import Depends, HTTPException, Security, status
69
from fastapi.security import APIKeyHeader, OAuth2PasswordBearer

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ ignore = [
9898
"N818", # Exception names - we keep "Exception" suffix for clarity
9999
"UP007", # Optional[X] is fine alongside X | None
100100
"N806", # Uppercase variables in functions (constants like PREFIX_LENGTH)
101+
"B008", # FastAPI uses Depends() in argument defaults by design
102+
"S106", # False positive for token_type="Bearer" string literals
101103
]
102104

103105
# Exclude patterns

0 commit comments

Comments
 (0)