# 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:
![example of the command output](./assets/example.png)
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
```bash
python3 -m pip install mypy-baseline
```
## Usage
Create the baseline (it will be stored in `mypy-baseline.txt` by default):
```bash
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:
```bash
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](https://mypy-baseline.orsinium.dev/)
Raw data
{
"_id": null,
"home_page": null,
"name": "mypy_baseline",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "mypy, baseline, typing, annotations, type annotations",
"author": null,
"author_email": "Gram <git@orsinium.dev>",
"download_url": "https://files.pythonhosted.org/packages/69/1f/694a1d21e1d441effaf7aef400c84644f08ff074dfe936f8e39deda4883d/mypy_baseline-0.7.2.tar.gz",
"platform": null,
"description": "# mypy-baseline\n\nA 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.\n\nAdditionally, the tool will show you what progress you made since the last baseline, to encourage your team to resolve mypy errors:\n\n![example of the command output](./assets/example.png)\n\nFeatures:\n\n+ Battle-tested.\n+ Fast and simple.\n+ Pure Python.\n+ No mypy patching or dirty magic. The tool works exclusively with the stdout of mypy.\n+ Nice stats with colors.\n+ Can detect exactly what errors were introduced and what errors were resolved, even if they are in the same file.\n+ Baseline is carefully crafted to avoid merge conflicts.\n+ 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.\n+ Track the progress you make with git-based history of changes and burndown chart of resolved type violations.\n+ Ignore specific error messages (using regular expressions) and error categories, so that buggy mypy plugins don't bother you with false-positives.\n\n## Installation\n\n```bash\npython3 -m pip install mypy-baseline\n```\n\n## Usage\n\nCreate the baseline (it will be stored in `mypy-baseline.txt` by default):\n\n```bash\nmypy | mypy-baseline sync\n```\n\nAfter that, you can pipe mypy output into `mypy-baseline filter`, and it will filter out all issues that are already in the baseline:\n\n```bash\nmypy | mypy-baseline filter\n```\n\nIf 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!\n\nRead more in the documentation: [mypy-baseline.orsinium.dev](https://mypy-baseline.orsinium.dev/)\n",
"bugtrack_url": null,
"license": null,
"summary": "Integrate mypy with existing codebase.",
"version": "0.7.2",
"project_urls": {
"Source": "https://github.com/orsinium-labs/mypy-baseline"
},
"split_keywords": [
"mypy",
" baseline",
" typing",
" annotations",
" type annotations"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "745909a7b342320cee87636c6a4df7a131f19b939b2b87148ded059ead1c7d05",
"md5": "fe9bd8e32d240ec21f1973f6d933f58c",
"sha256": "11db405082075f244c808d9268130ea95554ec2b8856b5c9bb09df539dc1836a"
},
"downloads": -1,
"filename": "mypy_baseline-0.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe9bd8e32d240ec21f1973f6d933f58c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17654,
"upload_time": "2024-10-17T08:39:40",
"upload_time_iso_8601": "2024-10-17T08:39:40.193847Z",
"url": "https://files.pythonhosted.org/packages/74/59/09a7b342320cee87636c6a4df7a131f19b939b2b87148ded059ead1c7d05/mypy_baseline-0.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "691f694a1d21e1d441effaf7aef400c84644f08ff074dfe936f8e39deda4883d",
"md5": "af2da84a1530dda3dba37b0dd9e4478d",
"sha256": "cffd6943a5d8959c15951ffe04f020c9010408711eee5113a507e0f1816d9a2d"
},
"downloads": -1,
"filename": "mypy_baseline-0.7.2.tar.gz",
"has_sig": false,
"md5_digest": "af2da84a1530dda3dba37b0dd9e4478d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 318825,
"upload_time": "2024-10-17T08:39:42",
"upload_time_iso_8601": "2024-10-17T08:39:42.850196Z",
"url": "https://files.pythonhosted.org/packages/69/1f/694a1d21e1d441effaf7aef400c84644f08ff074dfe936f8e39deda4883d/mypy_baseline-0.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-17 08:39:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "orsinium-labs",
"github_project": "mypy-baseline",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mypy_baseline"
}