[mypy] # Python version python_version = 3.12 # Django plugin # NOTE: mypy_django_plugin disabled due to django-stubs INTERNAL ERROR bug # (AssertionError: Must not defer during final iteration in request.pyi) # plugins = mypy_django_plugin.main # Import discovery mypy_path = . namespace_packages = True # Cache configuration cache_dir = .mypy_cache incremental = True # Warnings warn_return_any = True warn_unused_configs = True warn_redundant_casts = True warn_unused_ignores = True # Error handling ignore_missing_imports = True no_strict_optional = False allow_redefinition = True # Output show_error_codes = True show_column_numbers = True pretty = True # Strictness (globally enabled) check_untyped_defs = True disallow_untyped_defs = True disallow_incomplete_defs = True # ============================================================ # Per-module options: structural ignores # ============================================================ # --- Migrations (auto-generated, skip entirely) --- [mypy-*.migrations.*] ignore_errors = True # --- Tests (allow flexibility) --- [mypy-*.tests.*] disallow_untyped_defs = False disallow_incomplete_defs = False # --- Config migrator (complex migration logic) --- [mypy-apps.core.config.migrator] warn_return_any = False disallow_any_expr = False # --- Config migrator executor (accesses dynamic settings attributes via cast(Any)) --- [mypy-apps.core.config.migrator_executor] warn_return_any = False [mypy-tests.*] disallow_untyped_defs = False disallow_incomplete_defs = False [mypy-conftest] ignore_errors = False # ============================================================ # Per-module options: existing code gradual adoption # These modules have legacy code that predates strict mode. # New code in these modules should still follow strict typing. # ============================================================ # --- Override: keep ignore_errors for out-of-scope models --- [mypy-apps.message_hub.models.message_source] ignore_errors = True [mypy-apps.pdf_splitting.models] ignore_errors = True [mypy-apps.oa_filing.models.case_import_session] ignore_errors = True [mypy-apps.message_hub.models.inbox_message] ignore_errors = True [mypy-apps.reminders.models] ignore_errors = False [mypy-apps.reminders.models.*] ignore_errors = False [mypy-apps.litigation_ai.models] ignore_errors = False [mypy-apps.litigation_ai.models.*] ignore_errors = False # --- Override: enable strict checking for core and organization models --- [mypy-apps.core.models] ignore_errors = False [mypy-apps.core.models.*] ignore_errors = False [mypy-apps.organization.models] ignore_errors = False [mypy-apps.organization.models.*] ignore_errors = False # --- Override: enable strict checking for contracts models (task 1.2) --- [mypy-apps.contracts.models] ignore_errors = False [mypy-apps.contracts.models.*] ignore_errors = False # --- Override: enable strict checking for client models (task 1.3) --- [mypy-apps.client.models] ignore_errors = False [mypy-apps.client.models.*] ignore_errors = False # --- Override: enable strict checking for documents models (task 1.4) --- [mypy-apps.documents.models] ignore_errors = False [mypy-apps.documents.models.*] ignore_errors = False # --- Override: enable strict checking for automation models (task 1.5) --- [mypy-apps.automation.models] ignore_errors = False [mypy-apps.automation.models.*] ignore_errors = False # --- Temporary typed-ratchet exceptions for legacy changed-files gate --- [mypy-apps.automation.models.preservation] ignore_errors = True # --- story_viz models use Django dynamic fields; defer strict typing ratchet --- [mypy-apps.story_viz.models] ignore_errors = True [mypy-apps.story_viz.models.*] ignore_errors = True [mypy-apps.cases.api.case_material_api] ignore_errors = True [mypy-apps.cases.services.material.case_material_binding_workflow] ignore_errors = True [mypy-apps.cases.services.material.case_material_service] ignore_errors = True [mypy-apps.client.admin.property_clue_admin] ignore_errors = True [mypy-apps.client.admin.client_admin] ignore_errors = True [mypy-apps.core.services.material_classification_service] ignore_errors = True # --- Contract review & related admin/API (legacy type debt) --- [mypy-apps.contract_review.admin.review_task_admin] ignore_errors = True [mypy-apps.contract_review.api.review_api] ignore_errors = True [mypy-apps.evidence_sorting.api.evidence_sorting_api] ignore_errors = True [mypy-apps.legal_solution.admin.task_admin] ignore_errors = True [mypy-apps.oa_filing.services.oa_scripts.jtn_case_import] ignore_errors = True # --- API layer (DRF views, serializers, dynamic patterns) --- # [mypy-apps.*.api.*] # ignore_errors = True # Removed in batch 3 # --- Services (large codebase, gradual migration) --- [mypy-apps.*.services.*] ignore_errors = False # --- Temporarily ignore other apps' services while fixing contracts --- # [mypy-apps.automation.services.*] # ignore_errors = True # Removed in batch 2 # [mypy-apps.documents.services.*] # ignore_errors = True # Removed in batch 2 # [mypy-apps.cases.services.*] # ignore_errors = True # Removed in batch 2 # --- Schemas (Pydantic/DRF serializer patterns) --- # [mypy-apps.*.schemas] # ignore_errors = True # Removed in batch 3 # [mypy-apps.*.schemas.*] # ignore_errors = True # Removed in batch 3 # --- Management commands --- # ============================================================ # Per-module options: third-party libraries without type stubs # ============================================================ # ============================================================ # django-stubs plugin configuration # ============================================================ [mypy.plugins.django-stubs] django_settings_module = apiSystem.settings # --- Scripts (utility scripts, not part of main codebase) --- [mypy-scripts.*] ignore_errors = True [mypy-PIL.*] ignore_missing_imports = True