Silence mypy by adding or removing code comments
MIT License
Automatically add or remove # type: ignore
commends to silence mypy. Inspired by pylint-silent
Imagine you want to add type check for a legacy code base which has thounds of exisiting mypy errors.
Instead of trying to fix all the exisiting errors, mypy-silent
allows you to ignore the exisiting errors and adopt type checking right now.
Although the exisiting errors are ignored, all the new code are type checked -- so you can moving towards fully type checked step by step.
WARNING: mypy-silent
modifies files in place. You should use some version control system ( like git ) to prevent losing codes.
pip install mypy-silent
mypy . # Whoa, lots of type error!
mypy . | mypy-silent # mypy-silent will add or remove `# type: ignore` commends to your code
mypy . # mypy should report 0 errors now.
# type: ignore
we now add # type: ignore[misc]
#41