🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

flake8-annotations-coverage

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flake8-annotations-coverage

A flake8 extension that checks for type annotations coverage

0.0.6
PyPI
Maintainers
3

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 codeDescription
TAE001Too few type annotations in file

Contributing

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

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

Here are useful tips:

Keywords

flake8 annotations

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts