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.1.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file mypy_helper-0.1.1.tar.gz
.
File metadata
- Download URL: mypy_helper-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b38575e38275727b04773c2f1fd2b5163677812f5413d098cd3d38ae4afb26 |
|
MD5 | d13e5517225cd27769722a082459e54b |
|
BLAKE2b-256 | b07519e8b07bac9f83556410da5d42e6b7ee0add79537df0678dc796b98bdaeb |
File details
Details for the file mypy_helper-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: mypy_helper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1caaf5f8efe43673a98e9aa9242b3828a4e59bb4decd75737f8babdf8d105a07 |
|
MD5 | a265170a89bf94d8b856582d83fc8680 |
|
BLAKE2b-256 | 2a39268eda123d2a560cafa94abe8f8c23f979f1aeb2e0d553b5bb35c93838d8 |