Skip to content

chore: add mypy strict type checking#14

Merged
heznpc merged 1 commit intomainfrom
chore/add-mypy
Apr 22, 2026
Merged

chore: add mypy strict type checking#14
heznpc merged 1 commit intomainfrom
chore/add-mypy

Conversation

@heznpc
Copy link
Copy Markdown
Member

@heznpc heznpc commented Apr 22, 2026

Summary

Adds static type checking to the Python starter — closes the 2026-04-23 audit finding that type hints were present but never verified.

  • pyproject.toml: mypy in [project.optional-dependencies].dev, [tool.mypy] with strict = true, warn_unused_ignores, warn_redundant_casts, warn_unreachable, show_error_codes. Tests exempted from disallow_untyped_defs.
  • .github/workflows/ci.yml: new Type check step runs mypy src/ across Python 3.11 / 3.12 / 3.13.
  • src/my_mcp_server/server.py: tighten dictdict[str, object] on ok() / err() helpers (strict mode requires generic parameters).

Test plan

  • Local: mypy src/Success: no issues found in 5 source files
  • Local: pytest → 2 passed; ruff check . → all passed
  • CI green across 3.11, 3.12, 3.13

- pyproject.toml: add mypy to dev deps, [tool.mypy] with strict = true, override to relax tests
- ci.yml: add 'Type check' step running mypy src/ on all 3 Python versions
- server.py: tighten dict annotations to dict[str, object] to pass strict mode

Locally: mypy src/ → 'Success: no issues found in 5 source files'. pytest + ruff still green.
@heznpc heznpc merged commit 1d66874 into main Apr 22, 2026
7 checks passed
@heznpc heznpc deleted the chore/add-mypy branch April 22, 2026 18:46
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