mirror of
https://github.com/aljazceru/Auditor.git
synced 2025-12-17 03:24:18 +01:00
21 lines
655 B
Python
21 lines
655 B
Python
"""Ensure minimal mypy config exists (idempotent)."""
|
|
|
|
import click
|
|
|
|
|
|
@click.command("init-config")
|
|
@click.option("--pyproject", default="pyproject.toml", help="Path to pyproject.toml")
|
|
def init_config(pyproject):
|
|
"""Ensure minimal mypy config exists (idempotent)."""
|
|
from theauditor.config import ensure_mypy_config
|
|
|
|
try:
|
|
res = ensure_mypy_config(pyproject)
|
|
msg = (
|
|
"mypy config created"
|
|
if res.get("status") == "created"
|
|
else "mypy config already present"
|
|
)
|
|
click.echo(msg)
|
|
except Exception as e:
|
|
raise click.ClickException(f"Failed to init config: {e}") from e |