Skip to main content

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

Project description

Mypy Clean Slate

Ignore all errors thrown by mypy so as to provide a "clean slate" from which to run mypy with strict settings.

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)

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:

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

would be manually rewritten as

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mypy_clean_slate-0.1.2.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

mypy_clean_slate-0.1.2-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page