Files
gh-christianlouis-docuelevate/test_ruff_annotated_none.py
T
google-labs-jules[bot] 829e95d674 style: fix Annotated pattern in audit_logs.py to resolve Ruff B008 and maintain compatibility
Refactor `app/api/audit_logs.py` to use the `Annotated` type hint pattern while maintaining default values for dependencies using module-level singletons.

- Resolves B008: Function-call in default argument.
- Maintains compatibility with decorators (e.g., `@require_login`) that call the function without explicitly providing the `db` argument.
- Uses standard FastAPI patterns for query parameters with constant defaults.
- No changes to API runtime behavior.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
2026-03-16 08:50:05 +00:00

7 lines
170 B
Python

from typing import Annotated
def Depends(x): return x
def get_db(): return "db"
DbSession = Annotated[str, Depends(get_db)]
def test_func(db: DbSession = None):
pass