mypy-baseline is a friendly CLI tool designed to integrate the `mypy` static type checker into existing Python projects. It works by creating and managing a 'baseline' file of current type errors, allowing developers to focus on new errors introduced while gradually addressing the existing technical debt. Currently at version 0.7.3, it maintains an active development and release cadence.
pip install mypy-baselineNo compatibility data collected yet for this library.
To get started, first ensure your mypy configuration (typically in `pyproject.toml`) includes `show_error_codes = true`. Then, generate an initial baseline to record all existing type errors. Subsequent runs can then filter mypy's output to only show new errors, helping to incrementally improve type coverage.
Add `show_error_codes = true` under your `[tool.mypy]` section in `pyproject.toml` or equivalent mypy configuration.
Upgrade to mypy-baseline 0.7.3 or newer to ensure correct baseline synchronization when using the `--sort-baseline` option.
Upgrade to mypy-baseline 0.7.2 or newer to ensure `pyproject.toml` configurations (e.g., for `baseline_path`) are correctly respected.
Run `mypy | mypy-baseline sync` to update your baseline file after resolving existing errors or making changes that affect the baseline.
Install mypy using pip: 'python3 -m pip install mypy'.
Install mypy-baseline using pip: 'python3 -m pip install mypy-baseline'.
Ensure the command is correctly formatted: 'mypy | mypy-baseline sync'.
Update mypy to the latest version using pip: 'python3 -m pip install --upgrade mypy'.
Update mypy-baseline to the latest version using pip: 'python3 -m pip install --upgrade mypy-baseline'.