Integrate mypy with existing codebase.
Project description
mypy-baseline
A CLI tool for painless integration of mypy with an existing Python project. When you run it for the first time, it will remember all type errors that you already have in the project (generate "baseline"). All consecutive runs will ignore these errors and report only ones that you introduced after that.
Additionally, the tool will show you what progress you made since the last baseline, to encourage your team to resolve mypy errors:
Features:
- Battle-tested.
- Fast and simple.
- Pure Python.
- No mypy patching or dirty magic. The tool works exclusively with the stdout of mypy.
- Nice stats with colors.
- Can detect exactly what errors were introduced and what errors were resolved, even if they are in the same file.
- Baseline is carefully crafted to avoid merge conflicts.
- Baseline is human-readable, and diffs are informative. The reviewers of your PR will know exactly what errors you resolve and what errors you introduced.
- Track the progress you make with git-based history of changes and burndown chart of resolved type violations.
- Ignore specific error messages (using regular expressions) and error categories, so that buggy mypy plugins don't bother you with false-positives.
Installation
python3 -m pip install mypy-baseline
Usage
Create the baseline (it will be stored in mypy-baseline.txt
by default):
mypy | mypy-baseline sync
After that, you can pipe mypy output into mypy-baseline filter
, and it will filter out all issues that are already in the baseline:
mypy | mypy-baseline filter
If you introduce new errors, resolve them. If you resolve existing errors, run mypy-baseline sync
again to re-generate baseline. In both cases, mypy-baseline will tell you what's wrong and what to do. Enjoy the ride!
Read more in the documentation: mypy-baseline.orsinium.dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mypy_baseline-0.6.1.tar.gz
.
File metadata
- Download URL: mypy_baseline-0.6.1.tar.gz
- Upload date:
- Size: 319.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f594edf1489aa6bd5403d5183127f3fc045a591b9d6aa91530f0d7cfe61de01 |
|
MD5 | 29547d3d48ece21a243f8c869bcef998 |
|
BLAKE2b-256 | 7e96790f9b56191c2fe5882ea9a8c75aa77059f8bb6811c95157459982d3710c |
File details
Details for the file mypy_baseline-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: mypy_baseline-0.6.1-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a2c3646bdb57fc6753599b7a67b58836924c9132208ab41f14260ab510a60c6 |
|
MD5 | 31be52ffb538a4b8054410e31c93d014 |
|
BLAKE2b-256 | 0c565430a9b781fed0f4d7c13065b84a3ed136a036cc47bfe0823893d8dc6953 |