Skip to content

Commit da8647e

Browse files
committed
Enable full run of pre-commit for quality check
1 parent e3d1ed5 commit da8647e

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/action@v3.0.1
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
@@ -88,7 +88,8 @@ ignore-words-list = [
8888
quiet-level = 3
8989
# https://docs.astral.sh/ruff/settings/
9090
[tool.ruff]
91-
extend-exclude = []
91+
extend-exclude = [
92+
]
9293
force-exclude = true
9394
line-length = 120
9495
# Assume Python 3.9
@@ -206,27 +207,25 @@ commands = [
206207
]
207208

208209
[tool.tox.env.format]
209-
description = "Run ruff code formatter."
210+
description = "Run code formatter and code-fixing linter."
210211
skip_install = true
211-
deps = ["ruff==0.11.13"]
212+
deps = ["pre-commit"]
212213
commands = [
213-
["ruff", "format", "{posargs:.}"],
214+
["pre-commit", "run", "--all-files", "--show-diff-on-failure", { replace = "posargs", extend = true }]
214215
]
215216

216217
[tool.tox.env.format_check]
217218
description = "Check that code is correctly formatted by ruff."
218219
skip_install = true
219220
deps = ["ruff==0.11.13"]
220-
commands = [
221-
["ruff", "format", "--check", "{posargs:.}"],
222-
]
223221

224222
[tool.tox.env.lint]
225223
description = "Run code linter and formatter (no fixes)."
226224
skip_install = true
227225
deps = ["ruff==0.11.13"]
228226
commands = [
229227
["ruff", "check", "{posargs:.}"],
228+
["ruff", "format", "{posargs:.}"],
230229
]
231230

232231
[tool.uv-dynamic-versioning]

0 commit comments

Comments
 (0)