Metadata-Version: 2.1
Name: mypy-clean-slate
Version: 0.1.3
Summary: CLI tool for providing a clean slate for mypy usage within a project.
Home-page: https://github.com/geo7/mypy_clean_slate
License: MIT
Keywords: mypy,typing,typehint,type-hint
Author: George Lenton
Author-email: georgelenton@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: autoflake (>=1.4,<2.0)
Requires-Dist: black (>=21.6b0,<22.0)
Requires-Dist: flake8 (>=3.9.2,<4.0.0)
Requires-Dist: flake8-docstrings (>=1.6.0,<2.0.0)
Requires-Dist: flake8-eradicate (>=1.1.0,<2.0.0)
Requires-Dist: flake8-return (>=1.1.3,<2.0.0)
Requires-Dist: ipython (>=7.25.0,<8.0.0)
Requires-Dist: isort (>=5.9.2,<6.0.0)
Requires-Dist: mypy (>=0.910,<0.911)
Requires-Dist: pre-commit (>=2.13.0,<3.0.0)
Requires-Dist: pylint (>=2.9.3,<3.0.0)
Description-Content-Type: text/markdown

# Mypy Clean Slate

CLI tool for providing a clean slate for mypy usage within a project

It can be difficult to get a large project to the point where `mypy --strict` can be run on it. Rather than incrementally increasing the severity, either overall or per module, `mypy_clean_slate` enables one to ignore all previous errors so that `mypy --strict` (or similar) can be used immediately.


# Usage

```
usage: main.py [-h] [-n] [-r] [-a] [-o MYPY_REPORT_OUTPUT]

CLI tool for providing a clean slate for mypy usage within a project.

optional arguments:
  -h, --help            show this help message and exit
  -n, --none            Handle missing "-> None" hints on functions.
  -r, --generate_mypy_error_report
                        Generate 'mypy_error_report.txt' in the cwd.
  -a, --add_type_ignore
                        Add "# type: ignore[<error-code>]" to suppress all raised mypy errors.
  -o MYPY_REPORT_OUTPUT, --mypy_report_output MYPY_REPORT_OUTPUT
                        File to save report output to (default is mypy_error_report.txt)
```

See `./tests/test_mypy_clean_slate.py` for an example.

# Issues

## Handling lines with preexisting ignores.

If there are instances of `pylint: disable` or `noqa: ` ignores then these currently have
to be handled separately. eg:

```python
def add(a, b): # pylint: disable=invalid-name
    return a + b
```

would be manually rewritten as

```python
def add(a, b): # type: ignore[no-untyped-def] # pylint: disable=invalid-name
    return a + b
```

# TODO

* handle there being different types of ignores (pylint/flake8/etc) already within the
  code.

