Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/best-doctor/flake8-annotations-coverage
flake8 plugin to validate annotations coverage
https://github.com/best-doctor/flake8-annotations-coverage
annotations flake8 flake8-plugin
Last synced: about 2 months ago
JSON representation
flake8 plugin to validate annotations coverage
- Host: GitHub
- URL: https://github.com/best-doctor/flake8-annotations-coverage
- Owner: best-doctor
- License: mit
- Created: 2019-02-06T08:29:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T19:09:30.000Z (over 2 years ago)
- Last Synced: 2024-05-11T22:44:53.662Z (about 2 months ago)
- Topics: annotations, flake8, flake8-plugin
- Language: Python
- Size: 27.3 KB
- Stars: 34
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-flake8-extensions - flake8-annotations-coverage - Plugin to validate annotations coverage. (Type annotations)
README
# flake8-annotations-coverage
[![Build Status](https://github.com/best-doctor/flake8-annotations-coverage/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/best-doctor/flake8-annotations-coverage/actions/workflows/build.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/8480286aaae1c0612351/maintainability)](https://codeclimate.com/github/best-doctor/flake8-annotations-coverage/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/8480286aaae1c0612351/test_coverage)](https://codeclimate.com/github/best-doctor/flake8-annotations-coverage/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
```bash
pip install flake8-annotations-coverage
```## Example
Sample file:
```python
# test.pydef annotated_function(some_arg: int):
passdef unannotated_function():
pass
```Usage:
```terminal
$ 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.
1. Create a pull request. Make sure all checks are green.
1. Fix review comments if any.
1. Be awesome.Here are useful tips:
- You can run all checks and tests with `make check`.
Please do it before CI does.
- We use [BestDoctor python styleguide](https://github.com/best-doctor/guides/blob/master/guides/en/python_styleguide.md).
- We respect [Django CoC](https://www.djangoproject.com/conduct/).
Make soft, not bullshit.