Skip to main content

A plugin for flake8 to enable linting .pyi files.

Project description

A plugin for Flake8 that provides specializations for type hinting stub files, especially interesting for linting typeshed.

Functionality

  1. Adds the .pyi extension to the default value of the --filename command-line argument to Flake8. This means stubs are linted by default with this plugin enabled, without needing to explicitly list every file.

  2. Modifies PyFlakes runs for .pyi files to defer checking type annotation expressions after the entire file has been read. This enables support for first-class forward references that stub files use.

The latter should ideally be merged into flake8 as the integration is currently pretty brittle (might break with future versions of pyflakes, flake8, or due to interactions with other overly clever plugins).

List of warnings

Currently this plugin doesn’t add any warnings of its own. It does reserve codes starting with Y0.

License

MIT

Tests

Just run:

python3.6 setup.py test

Note: tests require 3.6+ due to testing variable annotations.

Change Log

16.12.2

  • handle annotated assignments in 3.6+ with forward reference support

16.12.1

  • handle forward references during subclassing on module level

  • handle forward references during type aliasing assignments on module level

16.12.0

  • first published version

  • date-versioned

Authors

Glued together by Łukasz Langa.

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-pyi-16.12.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distributions

flake8_pyi-16.12.2-py35.py36-none-any.whl (6.2 kB view details)

Uploaded Python 3.5 Python 3.6

flake8_pyi-16.12.2-py3.6.egg (6.9 kB view details)

Uploaded Source

File details

Details for the file flake8-pyi-16.12.2.tar.gz.

File metadata

File hashes

Hashes for flake8-pyi-16.12.2.tar.gz
Algorithm Hash digest
SHA256 4659f3747f491b3d02dfe13a717d3f3fa3b2dd87a8266dad3ad6bc86f36423d8
MD5 4fb30edc03a4fbc5d239db1e0e962713
BLAKE2b-256 0fab6fd8bb53c91f956f4778ab7cc2aa438c4d5b4334551add30e762875d1d24

See more details on using hashes here.

Provenance

File details

Details for the file flake8_pyi-16.12.2-py35.py36-none-any.whl.

File metadata

File hashes

Hashes for flake8_pyi-16.12.2-py35.py36-none-any.whl
Algorithm Hash digest
SHA256 02205888236affd3378f009a3f46bd6e46792255d4346b7cf1f948515dd23815
MD5 cf8e1ed96daebb27408bdb0c341564fd
BLAKE2b-256 ffa366e8e1b231145bf378b5fd15f77e72605dad5de82f18b155d536b840e9f1

See more details on using hashes here.

Provenance

File details

Details for the file flake8_pyi-16.12.2-py3.6.egg.

File metadata

File hashes

Hashes for flake8_pyi-16.12.2-py3.6.egg
Algorithm Hash digest
SHA256 d05a76a06e9e9be059c0bf18e0d3bc9afc96aa5b5bd6a6b587ccd4d654280854
MD5 504ef2483ff651c11e6b5d26dd0d611a
BLAKE2b-256 2141dcba583ba1fcdb3c6b4147bc46002747134cd448f960abde4310a4187f73

See more details on using hashes here.

Provenance

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