Skip to content

Commit 886394d

Browse files
committed
Enable full run of pre-commit for quality check
1 parent bbf4f8b commit 886394d

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/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
@@ -95,7 +95,8 @@ ignore-words-list = [
9595
quiet-level = 3
9696
# https://docs.astral.sh/ruff/settings/
9797
[tool.ruff]
98-
extend-exclude = []
98+
extend-exclude = [
99+
]
99100
force-exclude = true
100101
line-length = 120
101102
# Assume Python 3.9
@@ -214,25 +215,23 @@ commands = [
214215
]
215216

216217
[tool.tox.env.format]
217-
description = "Run ruff code formatter."
218+
description = "Run code formatter and code-fixing linter."
218219
skip_install = true
219-
deps = ["ruff==0.11.13"]
220+
deps = ["pre-commit"]
220221
commands = [
221-
["ruff", "format", "{posargs:.}"],
222+
["pre-commit", "run", "--all-files", "--show-diff-on-failure", { replace = "posargs", extend = true }]
222223
]
223224

224225
[tool.tox.env.format_check]
225226
description = "Check that code is correctly formatted by ruff."
226227
skip_install = true
227228
deps = ["ruff==0.11.13"]
228-
commands = [
229-
["ruff", "format", "--check", "{posargs:.}"],
230-
]
231229

232230
[tool.tox.env.lint]
233231
description = "Run code linter and formatter (no fixes)."
234232
skip_install = true
235233
deps = ["ruff==0.11.13"]
236234
commands = [
237235
["ruff", "check", "{posargs:.}"],
236+
["ruff", "format", "{posargs:.}"],
238237
]

0 commit comments

Comments
 (0)