Skip to content

Commit cad67ed

Browse files
committed
fix: ignore spell-checking for fastapi Dependant
1 parent a9bb18a commit cad67ed

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

diracx-routers/src/diracx/routers/factory.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import dotenv
2020
from cachetools import TTLCache
2121
from fastapi import APIRouter, Depends, FastAPI, HTTPException, Request, status
22-
from fastapi.dependencies.models import Dependent
22+
from fastapi.dependencies.models import Dependant # codespell:ignore dependant
2323
from fastapi.exception_handlers import request_validation_exception_handler
2424
from fastapi.exceptions import RequestValidationError
2525
from fastapi.middleware.cors import CORSMiddleware
@@ -436,14 +436,16 @@ async def validation_error_handler(request: Request, exc: RequestValidationError
436436

437437

438438
def find_dependents(
439-
obj: APIRouter | Iterable[Dependent], cls: type[T]
439+
obj: APIRouter | Iterable[Dependant], cls: type[T] # codespell:ignore dependant
440440
) -> Iterable[type[T]]:
441441
if isinstance(obj, APIRouter):
442442
# TODO: Support dependencies of the router itself
443443
# yield from find_dependents(obj.dependencies, cls)
444444
for route in obj.routes:
445445
if isinstance(route, APIRoute):
446-
yield from find_dependents(route.dependent.dependencies, cls)
446+
yield from find_dependents(
447+
route.dependant.dependencies, cls # codespell:ignore dependant
448+
)
447449
return
448450

449451
for dependency in obj:

0 commit comments

Comments
 (0)