Skip to content

Commit 4880118

Browse files
committed
Enable full run of pre-commit for quality check
1 parent 3c42fc7 commit 4880118

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/main.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
python-version: 3.13
2929
- name: Install tox
3030
run: python -m pip install tox
31-
- name: Run codespell
32-
run: tox -e codespell
33-
- name: Run code format checks
34-
run: tox -e format_check
31+
- name: Run pre-commit checks
32+
uses: pre-commit/[email protected]
33+
with:
34+
extra_args: --all-files
3535

3636
test:
3737
needs:

pyproject.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ ignore-words-list = [
9393
quiet-level = 3
9494
# https://docs.astral.sh/ruff/settings/
9595
[tool.ruff]
96-
extend-exclude = []
96+
extend-exclude = [
97+
]
9798
force-exclude = true
9899
line-length = 120
99100
# Assume Python 3.9
@@ -211,27 +212,25 @@ commands = [
211212
]
212213

213214
[tool.tox.env.format]
214-
description = "Run ruff code formatter."
215+
description = "Run code formatter and code-fixing linter."
215216
skip_install = true
216-
deps = ["ruff==0.11.13"]
217+
deps = ["pre-commit"]
217218
commands = [
218-
["ruff", "format", "{posargs:.}"],
219+
["pre-commit", "run", "--all-files", "--show-diff-on-failure", { replace = "posargs", extend = true }]
219220
]
220221

221222
[tool.tox.env.format_check]
222223
description = "Check that code is correctly formatted by ruff."
223224
skip_install = true
224225
deps = ["ruff==0.11.13"]
225-
commands = [
226-
["ruff", "format", "--check", "{posargs:.}"],
227-
]
228226

229227
[tool.tox.env.lint]
230228
description = "Run code linter and formatter (no fixes)."
231229
skip_install = true
232230
deps = ["ruff==0.11.13"]
233231
commands = [
234232
["ruff", "check", "{posargs:.}"],
233+
["ruff", "format", "{posargs:.}"],
235234
]
236235

237236
[tool.uv-dynamic-versioning]

0 commit comments

Comments
 (0)