forked from cardosofelipe/pragma-stack
refactor(backend): migrate type checking from mypy to pyright
Replace mypy>=1.8.0 with pyright>=1.1.390. Remove all [tool.mypy] and [tool.pydantic-mypy] sections from pyproject.toml and add pyrightconfig.json (standard mode, SQLAlchemy false-positive rules suppressed globally). Fixes surfaced by pyright: - Remove unreachable except AuthError clauses in login/login_oauth (same class as AuthenticationError) - Fix Pydantic v2 list Field: min_items/max_items → min_length/max_length - Split OAuthProviderConfig TypedDict into required + optional(email_url) inheritance - Move JWTError/ExpiredSignatureError from lazy try-block imports to module level - Add timezone-aware guard to UserSession.is_expired to match sibling models - Fix is_active: bool → bool | None in three organization repo signatures - Initialize search_filter = None before conditional block (possibly unbound fix) - Add bool() casts to model is_expired and repo is_active/is_superuser returns - Restructure except (JWTError, Exception) into separate except clauses
This commit is contained in:
23
backend/pyrightconfig.json
Normal file
23
backend/pyrightconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"include": ["app"],
|
||||
"exclude": ["app/alembic"],
|
||||
"pythonVersion": "3.12",
|
||||
"venvPath": ".",
|
||||
"venv": ".venv",
|
||||
"typeCheckingMode": "standard",
|
||||
"reportMissingImports": true,
|
||||
"reportMissingTypeStubs": false,
|
||||
"reportUnknownMemberType": false,
|
||||
"reportUnknownVariableType": false,
|
||||
"reportUnknownArgumentType": false,
|
||||
"reportUnknownParameterType": false,
|
||||
"reportUnknownLambdaType": false,
|
||||
"reportReturnType": true,
|
||||
"reportUnusedImport": false,
|
||||
"reportGeneralTypeIssues": false,
|
||||
"reportAttributeAccessIssue": false,
|
||||
"reportArgumentType": false,
|
||||
"strictListInference": false,
|
||||
"strictDictionaryInference": false,
|
||||
"strictSetInference": false
|
||||
}
|
||||
Reference in New Issue
Block a user