Skip to content

Commit

Permalink
chore: explicitly use the 'ruff check' command (#1683)
Browse files Browse the repository at this point in the history
Modern `ruff` requires explicitly saying `ruff check` for checks (since
there's `format` now). Not doing this outputs a warning explaining that
it should be done.

This adjusts the templates to include `check` explicitly (both in lint
and format).

Co-authored-by: Claudio Matsuoka <[email protected]>
Co-authored-by: Alex Lowe <[email protected]>
  • Loading branch information
3 people authored Jun 11, 2024
1 parent f46fb73 commit b48b8c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charmcraft/templates/init-kubernetes/tox.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deps =
ruff
commands =
ruff format {[vars]all_path}
ruff --fix {[vars]all_path}
ruff check --fix {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -41,7 +41,7 @@ commands =
# and uncomment the following line
# codespell {[vars]lib_path}
codespell {tox_root}
ruff {[vars]all_path}
ruff check {[vars]all_path}
ruff format --check --diff {[vars]all_path}

[testenv:unit]
Expand Down
4 changes: 2 additions & 2 deletions charmcraft/templates/init-machine/tox.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deps =
ruff
commands =
ruff format {[vars]all_path}
ruff --fix {[vars]all_path}
ruff check --fix {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -41,7 +41,7 @@ commands =
# and uncomment the following line
# codespell {[vars]lib_path}
codespell {tox_root}
ruff {[vars]all_path}
ruff check {[vars]all_path}
ruff format --check --diff {[vars]all_path}

[testenv:unit]
Expand Down
4 changes: 2 additions & 2 deletions charmcraft/templates/init-simple/tox.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ deps =
ruff
commands =
ruff format {[vars]all_path}
ruff --fix {[vars]all_path}
ruff check --fix {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -41,7 +41,7 @@ commands =
# and uncomment the following line
# codespell {[vars]lib_path}
codespell {tox_root}
ruff {[vars]all_path}
ruff check {[vars]all_path}
ruff format --check --diff {[vars]all_path}

[testenv:unit]
Expand Down

0 comments on commit b48b8c5

Please sign in to comment.