summaryrefslogtreecommitdiff
path: root/pyproject.toml
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-27 09:56:02 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-12-27 10:00:19 -0500
commit00f681d6a63c66740a2a93ee138f351b531430b0 (patch)
treebddae0eb97ddb6679b212c85c7d592013bb648c9 /pyproject.toml
parentcf3fe635dd63217c0999c372aadae5a14741b1c5 (diff)
downloadpython-coveragepy-git-00f681d6a63c66740a2a93ee138f351b531430b0.tar.gz
test: add mypy just for one file at first
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml28
1 files changed, 28 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 4b13c41f..a9c7db12 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,3 +4,31 @@
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'
+
+[tool.mypy]
+# mypy settings started from https://quantlane.com/blog/type-checking-large-codebase/
+# Ensure full coverage
+disallow_untyped_calls = true
+disallow_untyped_defs = true
+disallow_incomplete_defs = true
+disallow_untyped_decorators = true
+check_untyped_defs = true
+
+# Restrict dynamic typing
+disallow_any_generics = true
+disallow_subclassing_any = true
+warn_return_any = true
+
+# Know exactly what you're doing
+warn_redundant_casts = true
+warn_unused_ignores = true
+warn_unused_configs = true
+warn_unreachable = true
+show_error_codes = true
+
+# Explicit is better than implicit
+no_implicit_optional = true
+
+# Don't follow imports
+ignore_missing_imports = true
+follow_imports = "silent"