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

17.1.0

  • handle del statements in stub files

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-17.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3.5 Python 3.6

File details

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

File metadata

  • Download URL: flake8-pyi-17.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flake8-pyi-17.1.0.tar.gz
Algorithm Hash digest
SHA256 3eee899cc98149e896adf90a5f4debf70287ffee66823c014aafcc4d2d208c9b
MD5 f9c7da04876c9ebba0b0ac229b01c94f
BLAKE2b-256 7bd92780399299f4ef2a86bad80c8ad5fff14b7d2262cefe4cf872374fd51dd7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for flake8_pyi-17.1.0-py35.py36-none-any.whl
Algorithm Hash digest
SHA256 66c57fba7677e838d2cd46519a73a12192eb01d4b6c1574400ed69bd9423b4d8
MD5 bfd7a215b298bc7d31784ef6e87a30bc
BLAKE2b-256 f17a7c64cf7b19f4a8730fa067549e852cf48f0b031f12ee6afbc015ff87af52

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