Skip to main content

A flake8 extension that checks for type annotations coverage

Project description

# flake8-annotations-coverage

[![Build Status](](

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 git+

## Example

Sample file:


def annotated_function(some_arg: int):

def unannotated_function():


$ flake8 TAE001 too few type annotations

Tested on Python 3.6.5 and flake8 3.7.4.

## 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:

- You can run all checks and tests with `make check`. Please do it before TravisCI does.
- We use [BestDoctor python styleguide]( Sorry, styleguide is available only in Russian for now.
- We respect [Django CoC]( Make soft, not bullshit.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for flake8-annotations-coverage, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size flake8_annotations_coverage-0.0.2.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page