The codebase currently lacks type hints. Adding type hints would greatly increase the ability for static type checkers like mypy to enforce type-safety and catch bugs at type-checking time.
Adding mypy or an equivalent type checker to pre-commit would help maintain type-safety during the development process.
Operationally, I would suggest adding a type checker like mypy to the pre-commit configuration, but exempting all modules from type checking (because they would all fail).
One by one, modules would be added to mypy's scope, and that module would receive complete type annotations. This should be a safe way to gradually type the entire codebase.
The codebase currently lacks type hints. Adding type hints would greatly increase the ability for static type checkers like
mypyto enforce type-safety and catch bugs at type-checking time.Adding
mypyor an equivalent type checker topre-commitwould help maintain type-safety during the development process.Operationally, I would suggest adding a type checker like
mypyto the pre-commit configuration, but exempting all modules from type checking (because they would all fail).One by one, modules would be added to mypy's scope, and that module would receive complete type annotations. This should be a safe way to gradually type the entire codebase.