Skip to content

Commit 6110767

Browse files
committed
Enable full run of pre-commit for quality check
1 parent 6a56340 commit 6110767

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
run: poetry check
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
@@ -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
@@ -207,25 +208,23 @@ commands = [
207208
]
208209

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

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

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

0 commit comments

Comments
 (0)