From 38ee26581e54c2e48927552d63bca5f1cdd1968a Mon Sep 17 00:00:00 2001 From: Simon Alling Date: Wed, 15 Oct 2025 20:10:27 +0200 Subject: [PATCH] Finds a lot of type errors due to contravariance or whatever --- Dockerfile | 1 + mypy.ini | 5 +++++ src/modules/__init__.py | 0 typecheck | 3 +-- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 mypy.ini create mode 100644 src/modules/__init__.py diff --git a/Dockerfile b/Dockerfile index 42793fc..5912e5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ COPY --from=builder /root/.local/lib /root/.local/lib COPY --from=builder /root/.local/bin/mitmdump /root/.local/bin/mitmdump COPY --from=builder /root/.local/bin/mypy /root/.local/bin/mypy ENV PATH=/root/.local/bin:$PATH +COPY mypy.ini . COPY typecheck . COPY src src COPY default-rules default-rules diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..359eae6 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,5 @@ +[mypy] +mypy_path = $MYPY_CONFIG_FILE_DIR/src +explicit_package_bases = True +namespace_packages = True +files = $MYPY_CONFIG_FILE_DIR/src diff --git a/src/modules/__init__.py b/src/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/typecheck b/typecheck index 826d5c2..002e685 100755 --- a/typecheck +++ b/typecheck @@ -4,5 +4,4 @@ set -e export MYPYPATH=/usr/local/lib/python3.6/dist-packages/ -mypy src/*.py --ignore-missing-imports --disallow-untyped-defs --follow-imports skip -mypy src/modules/*.py --ignore-missing-imports --disallow-untyped-defs --follow-imports skip +mypy src/ --config-file mypy.ini --ignore-missing-imports --disallow-untyped-defs