A flake8 plugin to ban type hints.
Project description
A flake8 plugin to ban type hints.
This can be useful in code bases where you aren’t running type checking (yet?) but developers or their IDE’s add type hints that can be incorrect.
Requirements
Python 3.6 to 3.9 supported.
Installation
First, install with pip:
python -m pip install flake8-no-types
Second, check that flake8 lists the plugin in its version line:
$ flake8 --version 3.7.9 (flake8-no-types: 1.0.0, mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.8.0 on Darwin
Third, add the NT prefix to your select list. For example, if you have your configuration in setup.cfg:
[flake8] select = E,F,W,NT
Linting a Django project? Check out my book Speed Up Your Django Tests which covers loads of best practices so you can write faster, more accurate tests.
Rules
NT001: No type hints.
Flags all forms of type hints:
- Function annotations: def foo() -> int:
- Variable hints: foo: int = 1
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size flake8_no_types-1.1.1-py3-none-any.whl (3.9 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Filename, size flake8-no-types-1.1.1.tar.gz (9.8 kB) | File type Source | Python version None | Upload date | Hashes View |
Close
Hashes for flake8_no_types-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 285724fda24390047f9e0a600947015531546243d8167925284f974e8b279724 |
|
MD5 | 85acbb113d9622f40f7e628a9a42b9c9 |
|
BLAKE2-256 | 894af4eabf638b0986bcb731a67820c8a09dca2f17d09df69e91566f9fd0e3c1 |