Skip to main content

flake8-annotations-coverage

Build Status Maintainability Test Coverage

An extension for flake8 to report on files with a lot of code without type annotations.

This is mostly useful when you add type annotations to existing large codebase and want to know if new code in annotated modules is annotated.

Minimal annotations coverage percentage for each file can be configured via --min-coverage-percents option, default is 75.

Function is treated as annotated if it has annotation for at least one argument or return type. This is enough for mypy to threat the function not as dynamically typed.

Installation

pip install flake8-annotations-coverage

Example

Sample file:

# test.py

def annotated_function(some_arg: int):
    pass


def unannotated_function():
    pass

Usage:

$ flake8 test.py
test.py:0:1: TAE001 too few type annotations

Error codes

Error code Description
TAE001 Too few type annotations in file

Contributing

We would love you to contribute to our project. It's simple:

  1. Create an issue with bug you found or proposal you have. Wait for approve from maintainer.
  2. Create a pull request. Make sure all checks are green.
  3. Fix review comments if any.
  4. Be awesome.

Here are useful tips:

Metadata

Release files for flake8-annotations-coverage 0.0.6

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-annotations-coverage 0.0.6
File Size Uploaded
flake8_annotations_coverage-0.0.6.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-annotations-coverage 0.0.6
File Interpreter ABI Platform
flake8_annotations_coverage-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / flake8_annotations_coverage-0.0.6.tar.gz

Download URL flake8_annotations_coverage-0.0.6.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b94d34b35e558be23991d14f685a13a4a77a46c16586f9bbff90b40c13724ce1
BLAKE2b-256 checksum
How to use checksums
45c4b886d34b99909a65eb2d2be6aca8359a2826b436f4635ed58807a31f7524
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / flake8_annotations_coverage-0.0.6-py3-none-any.whl

Download URL flake8_annotations_coverage-0.0.6-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9662ca85d4b40acbe683bb87fa08d9ff28e28b2aab3d2403974b09a9ee5f6a04
BLAKE2b-256 checksum
How to use checksums
e77fb29442bd2697219d7b31ba9bd166e6277cff046621d8ca85ade57b3d36c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

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