summaryrefslogtreecommitdiff
path: root/mypy.ini
diff options
context:
space:
mode:
authorcapellancitizen <thecapellancitizen@gmail.com>2025-03-09 21:21:48 -0400
committerGitHub <noreply@github.com>2025-03-09 21:21:48 -0400
commit99509df8d8abf1e7b701a4a09cf170a362f6d878 (patch)
treea461549502fa9f37dc287789b6c7db81dfcd5368 /mypy.ini
parent0d2fc24f25f87562f0755b53dad6204efad1330d (diff)
Mypy type correctness (#3199)
Diffstat (limited to 'mypy.ini')
-rw-r--r--mypy.ini40
1 files changed, 40 insertions, 0 deletions
diff --git a/mypy.ini b/mypy.ini
new file mode 100644
index 00000000..e2563424
--- /dev/null
+++ b/mypy.ini
@@ -0,0 +1,40 @@
+[mypy]
+files = lib/**/*.py,tests/**/*.py
+
+# Some of our code "reuses" variable names in different blocks. Mypy doesn't like that by default.
+allow_redefinition = True
+
+# We use class properties, which mypy considers an error, probably because it's going to be deprecated.
+# Ignore that for now.
+disable_error_code = misc
+
+# A handful of strictness increases we can pass as it is
+warn_unused_configs = True
+warn_redundant_casts = True
+warn_unused_ignores = True
+
+strict_equality = True
+extra_checks = True
+disallow_subclassing_any = True
+disallow_untyped_decorators = True
+
+# An example of increased strictness: We can increase the strictness of parts of the code as we go.
+[mypy-lib.elements.clone]
+check_untyped_defs = True
+disallow_incomplete_defs = True
+disallow_untyped_defs = True
+
+# This part of the code will need some work before it'll start passing.
+[mypy-lib.tartan.*]
+ignore_errors = True
+
+# These libraries are missing type information
+[mypy-colormath2.*]
+ignore_missing_imports = True
+
+[mypy-winutils.*]
+ignore_missing_imports = True
+
+# ... And this one is ours but is missing type information for now anyway...
+[mypy-pyembroidery.*]
+ignore_missing_imports = True