A plugin for Flake8 that provides specializations for type hinting stub files, especially interesting for linting typeshed.
- 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. - 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).
Currently this plugin doesn't add any warnings of its own. It does reserve codes starting with Y0.
MIT
Just run:
python3.6 setup.py test
Note: tests require 3.6+ due to testing variable annotations.
- handle
del
statements in stub files
- handle annotated assignments in 3.6+ with forward reference support
- handle forward references during subclassing on module level
- handle forward references during type aliasing assignments on module level
- first published version
- date-versioned
Glued together by Łukasz Langa and Jelle Zijlstra.