Skip to main content

Flake8 Typing Annotations Enforcement Plugin

Overview

This Flake8 plugin is designed to enforce the usage of typing annotations in your Python code. By integrating this plugin into your Flake8 workflow, you can ensure that your codebase adheres to a consistent and explicit typing style, promoting better code readability and maintainability.

Features

  • Type Annotation Enforcement: The plugin checks your Python code for functions, variables, and parameters that lack type annotations and raises warnings or errors accordingly.

  • Selective Ignoring: Use inline comments to selectively ignore the type annotation checks for specific lines or blocks of code.

Installation

You can install this Flake8 plugin using pip:

pip install flake8-enforce-type-annotations

Usage

After installation, the plugin becomes available as part of your Flake8 toolchain. Simply run Flake8 on your project to enforce typing annotations:

flake8 your_project_directory

Configuration

You can configure the strictness of the enforcement by adjusting the plugin settings in your Flake8 configuration file (usually .flake8):

per-file-ignores = 
    utils.py:ETA002,ETA001

Inline Ignoring

If you need to bypass the type annotation checks for specific lines or blocks of code, you can use inline comments:

def unannotated_function():
    # ... code without type annotations

Contributing

Contributions to this Flake8 plugin are welcome! If you encounter issues or have ideas for improvements, please open an issue or submit a pull request on the GitHub repository.

License

This Flake8 plugin is distributed under the MIT License.

Metadata

Release files for flake8-enforce-type-annotations 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-enforce-type-annotations 0.1.1
File Size Uploaded
flake8-enforce-type-annotations-0.1.1.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-enforce-type-annotations 0.1.1
File Interpreter ABI Platform
flake8_enforce_type_annotations-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / flake8-enforce-type-annotations-0.1.1.tar.gz

Download URL flake8-enforce-type-annotations-0.1.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e36627a7b1abb5bfc3db5fddb7c2f0a4b1ac406005984ed05c386bbeaab51284
BLAKE2b-256 checksum
How to use checksums
022c5f6999d1ba254c50ae315a2969d838ab69e137c8b3a9745ddacc0f9e4dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / flake8_enforce_type_annotations-0.1.1-py3-none-any.whl

Download URL flake8_enforce_type_annotations-0.1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56f9b43c9c11eef0b019f997565d7c13b81644b678f9d246cbd7550a9268b321
BLAKE2b-256 checksum
How to use checksums
12d3800d1426afb7f3e853ed8c189ca08efe2b48d3704dad62eb09684a713969
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page