chore: tighten mypy strict mode and remove dead code

Enable warn_unreachable, extra_checks, local_partial_types in pyproject.
Remove dead defensive branches and AI-slop union members; replace narrow
band-aid type:ignore with proper signature widening or targeted ignores
for genuine runtime-defensive paths (double-checked locking, hook misuse,
unfollowed-import boundaries).
This commit is contained in:
Greyson LaLonde
2026-05-22 03:38:39 +08:00
parent 6d712a3686
commit b7cf1f0148
39 changed files with 242 additions and 484 deletions

View File

@@ -124,8 +124,11 @@ disallow_any_unimported = true
no_implicit_optional = true
check_untyped_defs = true
warn_return_any = true
warn_unreachable = true
show_error_codes = true
warn_unused_ignores = true
local_partial_types = true
extra_checks = true
python_version = "3.12"
exclude = "(?x)(^lib/crewai/src/crewai/cli/templates/|^lib/cli/src/crewai_cli/templates/|^lib/crewai/tests/|^lib/crewai-tools/tests/|^lib/crewai-files/tests/|^lib/cli/tests/|^lib/devtools/tests/)"
plugins = ["pydantic.mypy"]