diff --git a/pyproject.toml b/pyproject.toml index 203a503..c728f7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pyrgo" -version = "1.1.0" +version = "1.1.1" readme = "README.md" requires-python = ">=3.9" classifiers = [ diff --git a/pyrgo/cli/cmds/check.py b/pyrgo/cli/cmds/check.py index ceb4bf8..0048720 100644 --- a/pyrgo/cli/cmds/check.py +++ b/pyrgo/cli/cmds/check.py @@ -35,7 +35,14 @@ show_default=True, type=click.BOOL, ) -def check(*, timeout: int, add_noqa: bool, ignore_noqa: bool) -> None: +@click.option( + "--fix/--no-fix", + "fix", + default=True, + show_default=True, + type=click.BOOL, +) +def check(*, timeout: int, add_noqa: bool, ignore_noqa: bool, fix: bool) -> None: """Check code with `mypy` and `ruff`.""" configuration = PyrgoConf.new() ruff_command = PythonCommandExec.new(program="ruff") @@ -47,6 +54,8 @@ def check(*, timeout: int, add_noqa: bool, ignore_noqa: bool) -> None: ruff_command.add_args(args=["--add-noqa"]) if ignore_noqa: ruff_command.add_args(args=["--ignore-noqa"]) + if fix: + ruff_command.add_args(args=["--fix"]) for command in [ruff_command, mypy_command]: command.add_args(args=configuration.relevant_paths)