Skip to main content

A flake8 plugin to ban type hints.

Project description

https://img.shields.io/github/workflow/status/adamchainz/flake8-no-types/CI/master?style=for-the-badge https://img.shields.io/pypi/v/flake8-no-types.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

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 keep adding type hints that can end up being incorrect.

Installation

Install from pip with:

python -m pip install flake8-no-types

Python 3.6 to 3.9 supported.

When installed it will automatically be run as part of flake8; you can check it is being picked up with:

$ 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

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.

Complains about all forms of type hints:

  • Function annotations: def foo() -> int:

  • Variable hints: foo: int = 1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8-no-types-1.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

flake8_no_types-1.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file flake8-no-types-1.1.0.tar.gz.

File metadata

  • Download URL: flake8-no-types-1.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for flake8-no-types-1.1.0.tar.gz
Algorithm Hash digest
SHA256 19cff6fb893eb84e08f29d09ac6180604393a8cb4607060d76a1e66b45b32a30
MD5 472985d09f1449b6802c1b919a9067e1
BLAKE2b-256 b7ca3a8aef3fe64f4b8d42a1cbdd65bc183a211f17528afddd0b9148ee04b345

See more details on using hashes here.

File details

Details for the file flake8_no_types-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: flake8_no_types-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for flake8_no_types-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aca8f8d4efec805019a2028cdf9ff90d8417098e4b131162f117ae0b3110f971
MD5 e16719e89491f64faaa6ed75fd912ee1
BLAKE2b-256 a6869544eff0618c93e140903022b9f0ed1367fa8aa38e546519d15fdea6541a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page