From 501ca838c73c9f1ce993ed23498cce1f9611f65d Mon Sep 17 00:00:00 2001 From: Rockachopa Date: Sun, 26 Apr 2026 11:03:18 -0400 Subject: [PATCH] feat(ci): integrate mypy type checker (issue #157) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add mypy>=1.0 to requirements.txt - Create mypy.ini config (Python 3.11, ignore missing imports, warn_unused_ignores) - Add `make typecheck` target (runs mypy on scripts/ and tests/) - Update CI workflow to run typecheck before pytest - Type checker detected per project (Python → mypy) - Reports type errors via mypy output Closes #157 --- .gitea/workflows/test.yml | 3 +++ Makefile | 5 ++++- mypy.ini | 20 ++++++++++++++++++++ requirements.txt | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 mypy.ini diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index e5e2bba..cfc0bb1 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -17,6 +17,9 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + - name: Type check (mypy) + run: | + make typecheck - name: Run test suite run: | make test diff --git a/Makefile b/Makefile index c3d6fa2..90bbb8a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,7 @@ -.PHONY: test +.PHONY: test typecheck test: python3 -m pytest tests/test_ci_config.py scripts/test_*.py -v + +typecheck: + mypy scripts/ tests/ --config-file=mypy.ini --show-error-codes diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..10bc74d --- /dev/null +++ b/mypy.ini @@ -0,0 +1,20 @@ +[mypy] +# Compounding Intelligence Type Checker Configuration (Issue #157) +python_version = 3.11 +ignore_missing_imports = True +warn_unused_ignores = True +warn_redundant_casts = True +warn_return_any = True +show_error_codes = True +pretty = True + +# Per-module strictness +[mypy-tests.*] +disallow_untyped_defs = False + +[mypy-scripts.test_*] +disallow_untyped_defs = False + +# Optional: uncomment to enforce stricter checking gradually +# disallow_untyped_defs = True +# check_untyped_defs = True diff --git a/requirements.txt b/requirements.txt index 75b4ea8..b34fd64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ pytest>=8,<9 +mypy>=1.0 -- 2.43.0