flake8 plugin which makes sure that __init__ functions have a return type
Project description
flake8-init-return
flake8 plugin which forbids not having a return type on a class' __init__
function
installation
pip install flake8-init-return
flake8 codes
Code | Description |
---|---|
FIR100 | missing return value for initalizer |
rationale
As PEP-484 says, a class' __init__
functions ought to be annotated with -> None
. This plugin makes sure
that they are annotated, but it leaves up the type checking for another
tool.
This might be useful when a type checker is not yet integrated into a project's development flow.
as a pre-commit hook
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies: [flake8-init-return==1.0.0]
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.
Source Distribution
Built Distribution
Close
Hashes for flake8_init_return-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d97bd2de74dd1dbbdfc9125782a1dc9a0bf38a9d438f2d19513a42b123fb2bcc |
|
MD5 | 969d75c52197bafd73b7d0ca5e438b87 |
|
BLAKE2b-256 | 7ffe12e5765e0253ed0dbd4a9d62b7ef146a16fbf9d6477023da09a9d154d881 |