chore: add MyPy type checking config with baseline ignore rules

Adds [tool.mypy] section to pyproject.toml with permissive baseline settings
and disables error codes that fire against the existing untyped codebase.
Adds the mirrors-mypy pre-commit hook (v1.19.1) running over python/ at once.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eugene Mikhantyev
2026-03-29 13:10:03 +01:00
parent fc70a4785c
commit 3456a1df26
2 changed files with 33 additions and 0 deletions

View File

@@ -35,3 +35,12 @@ repos:
- id: flake8
files: ^python/
args: [--config=.flake8]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.19.1"
hooks:
- id: mypy
files: ^python/
args: [--config-file=pyproject.toml]
pass_filenames: false
additional_dependencies: []

View File

@@ -10,3 +10,27 @@ target-version = ["py310"]
[tool.isort]
profile = "black"
line_length = 100
[tool.mypy]
python_version = "3.10"
warn_return_any = false
warn_unused_configs = true
ignore_missing_imports = true
check_untyped_defs = false
disallow_untyped_defs = false
disable_error_code = [
"arg-type",
"attr-defined",
"union-attr",
"call-arg",
"assignment",
"var-annotated",
"annotation-unchecked",
"index",
"has-type",
"dict-item",
"misc",
"list-item",
"return-value",
"operator",
]