Skip to content

fix(ci): add --check-untyped-defs to mypy and fix test typing - #337

Merged
paruff merged 1 commit into
mainfrom
fix/mypy-check-untyped-defs
Aug 1, 2026
Merged

fix(ci): add --check-untyped-defs to mypy and fix test typing#337
paruff merged 1 commit into
mainfrom
fix/mypy-check-untyped-defs

Conversation

@paruff

@paruff paruff commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds --check-untyped-defs to the pre-commit mypy hook so untyped functions (mostly test helpers) are now type-checked too, and fixes all 97 errors this surfaced.

What changed

  • .pre-commit-config.yaml: mypy args now include --check-untyped-defs
  • core/integrations/market/census.py: widen discover_places_in_state return to dict[str, Any]
  • core/services/portfolio.py: widen monthly_income_series/compute_portfolio_performance returns to dict[str, Any]
  • core/management/commands/import_csv.py, populate_growth_areas.py: explicit typing for CSV row values / census values
  • 19 test files: narrowed dict | None results, replaced resp.url with resp["Location"], annotated mock datasets, narrowed Django Field unions, fixed timezone.timedeltadatetime.timedelta

Validation

  • pre-commit all green (ruff, mypy 296 files, djLint, gitleaks, etc.)
  • python manage.py test: 99 + 23 + 38 tests OK
  • pytest core/tests: 115 passed

@paruff
paruff merged commit 3ff4daf into main Aug 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant