]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Explicitly disallow some mypy checks for tests/
authorDenis Laxalde <denis.laxalde@dalibo.com>
Mon, 4 Oct 2021 09:20:55 +0000 (11:20 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 4 Oct 2021 16:34:23 +0000 (17:34 +0100)
When running mypy on the tests/ directory, the top-level mypy
configuration is used and strict mode is thus enforced whereas tests
code is not typed. As mypy might be run in people editors by default,
the current situation makes this uncomfortable.

By disabling obvious checks, we get a nicer developer experience. A more
straightforward option would be to set 'check_untyped_defs = False', but
this would prevent valid code to be checked, so the current proposal is
a trade-off.

.mypy.ini

index ea6e1e5b46410420f3afec310b113c6ad404fbd6..46466c5098c19e3a3fb9aa0a93048f8690fab5b3 100644 (file)
--- a/.mypy.ini
+++ b/.mypy.ini
@@ -13,3 +13,7 @@ ignore_missing_imports = True
 
 [mypy-shapely.*]
 ignore_missing_imports = True
+
+[mypy-tests.*]
+disallow_untyped_defs = False
+disallow_untyped_calls = False