Skip to main content

flake8 plugin which makes sure that __init__ functions have a return type

Project description

PyPi pre-commit.ci status Build and Test codecov

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 initializer

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.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_init_return-1.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

flake8_init_return-1.0.1-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file flake8_init_return-1.0.1.tar.gz.

File metadata

  • Download URL: flake8_init_return-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for flake8_init_return-1.0.1.tar.gz
Algorithm Hash digest
SHA256 790aee0fb0ee0d172944ba5d72d8a7f69a7d3cff4bb2c4b8aef61b3f433c7e44
MD5 9d247dc51b37b417f3e6a3c9216641ed
BLAKE2b-256 3d8e60e324a84a8d592ddec987d2f2eb457253214df6f03f61023d4c0cc6095a

See more details on using hashes here.

File details

Details for the file flake8_init_return-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_init_return-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9a657d3aceb045741c6d852ce92c8c092ff0b3fc438587ce63e85054c381dcca
MD5 9f0f6e933c3a8ad24525f303816fe425
BLAKE2b-256 dd37a35759d6db9a241607ef3cbc8cc9effbb0f842c2591c0a014c4da69e91c8

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