Skip to content

feat: add strict mypy static typing - #71

Merged
henryiii merged 3 commits into
masterfrom
henryiii/mypy
Aug 14, 2026
Merged

feat: add strict mypy static typing#71
henryiii merged 3 commits into
masterfrom
henryiii/mypy

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

The mypy pre-commit hook ran with no configuration, so it checked nothing. This PR adds a strict [tool.mypy] config to pyproject.toml and annotates the package.

  • clang ships no py.typed marker, so a mypy override treats clang.* as untyped and the libclang cursor/TU parameters are Any.
  • Strict mode found one latent type error: process_comment sliced strings with leading_spaces = float("inf"); it is now int | None.
  • Small refactors for clean types: renamed shadowed variables that held two types (result, indent, library_file), and sections entries are now tuples instead of 2-element lists.
  • mypy 2.x does not support python_version = "3.9"; the import was verified on Python 3.9 manually.

Assisted-by: ClaudeCode:claude-fable-5
Assisted-by: ClaudeCode:claude-fable-5
Assisted-by: ClaudeCode:claude-fable-5
@henryiii
henryiii merged commit 67addc1 into master Aug 14, 2026
12 checks passed
@henryiii
henryiii deleted the henryiii/mypy branch August 14, 2026 20:41
This was referenced Aug 14, 2026
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