Skip to content

Commit

Permalink
Fixable check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomperez98 committed Oct 24, 2023
1 parent d09b296 commit f9c462b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
11 changes: 10 additions & 1 deletion pyrgo/cli/cmds/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit f9c462b

Please sign in to comment.