From 3456a1df26df0949929108f5c79a652c2a838973 Mon Sep 17 00:00:00 2001 From: Eugene Mikhantyev Date: Sun, 29 Mar 2026 13:10:03 +0100 Subject: [PATCH] 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 --- .pre-commit-config.yaml | 9 +++++++++ pyproject.toml | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0600a7..226d6ae 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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: [] diff --git a/pyproject.toml b/pyproject.toml index 9ab3555..c0ee5c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", +]