No project description provided
Project description
Mypy Helper
A tool to generate type hints and fix mypy errors.
Installation
pip install mypy-helper
Usage
To see a list of available commands, run the following:
mypy-help --help
Rectifying 'ignore-without-code' issues
ignore-without-code
is a mypy error code enforcing the developer to provide error code for the "# type: ignore" comment.
The command fix-ignore-without-code
fixes ignore without code. Use this before you have tried your best to eleminate the ignore
- Usage: mypy-helper fix-ignore-without-code [OPTIONS] PATH MYPY_OUTPUT
- Options:
- -e, --ext TEXT Append another extension
- --help Show this message and exit.
example:
Firstly, run mypy
to collect errors.
mypy . --strict --enable-errror-code ignore-without-code > errors.txt
Secondly, fix the errors.
mypy-helper fix-ignore-without-code examples/simple_example examples/simple_example/errors.txt
before:
a = 1
b = 2
a = "1"
b = "1" # type: ignore
after:
a = 1
b = 2
a = "1"
b = "1" # type: ignore[assignment]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mypy_helper-0.1.0.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for mypy_helper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d8f7afb7d75c2f5aecc2a2fe9991837d0d72c0e29abd0881bdf2c6fe536d730 |
|
MD5 | 49df8d0fc1ea048614768daf2f7f2f5e |
|
BLAKE2b-256 | 2bb37de8fb92718993e442ed7c0859383810665cd73e798125d81965e4631328 |