-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Tighten up Mypy:
Our current config (lenient, incremental adoption):
- ✅ show_error_codes = True - MATCHES Wolt
- ❌ warn_return_any = False - Wolt: True
- ❌ disallow_untyped_defs = False - Wolt: True (most important!)
- ❌ check_untyped_defs = False - Wolt: True
- ❌ no_implicit_optional = False - Wolt: True
- ❌ ignore_missing_imports = True - Wolt recommends disallow_any_unimported = True
Current status: We're at 0 mypy errors with lenient settings. This is excellent progress!
Recommendation: Now that we have 0 errors, we should gradually tighten strictness:
Phase 1 (next PR):
- Enable no_implicit_optional = True - explicit Optional annotations
- Enable warn_return_any = True - catch Any leakage
- Enable check_untyped_defs = True - check untyped function bodies
Phase 2 (future):
4. Enable disallow_untyped_defs = True - require type hints (biggest impact)
5. Replace ignore_missing_imports = True with disallow_any_unimported = True
The key insight from Wolt: start strict for new code, be lenient with legacy. We could enable strict
settings globally and use per-module overrides for existing code.
Metadata
Metadata
Assignees
Labels
No labels