Nitrokey / pynitrokey

Python client for Nitrokey devices
Apache License 2.0
93 stars 28 forks source link

Extend strict mypy checks #443

Closed robin-nitrokey closed 9 months ago

robin-nitrokey commented 9 months ago

mypy has a strict mode that enables additional checks. Unfortunately, this mode can only be set globally, see https://github.com/python/mypy/issues/11401. As we started with a code base without type annotations, setting it globally is not realistic at the moment. In the initial implementation, I just enabled disallow_untyped_defs for the new code to emulate the strict mode:

https://github.com/Nitrokey/pynitrokey/blob/dc48ea4fb6c3dc2179dea818f2dc909c07ca4e78/pyproject.toml#L85-L94

But strict mode actually includes many more settings that we should also enable. See this comment for an example configuration: https://github.com/python/mypy/issues/11401#issuecomment-1662073159