Skip to content

Commit 6757a7a

Browse files
committed
Add tox and CI job to check all pre-commit hooks
This will only check the latest commit, not all the commits in the PR, but that's better than nothing.
1 parent a45fa1f commit 6757a7a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: "ubuntu-latest"
3232
strategy:
3333
matrix:
34-
toxenv: ["build", "pytype", "docs"]
34+
toxenv: ["build", "precommit", "pytype", "docs"]
3535
env:
3636
TOXENV: ${{ matrix.toxenv }}
3737

tox.ini

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ deps =
1212
commands =
1313
pytest {toxinidir} {posargs}
1414

15+
[testenv:precommit]
16+
description = Run the pre-commit hooks on all files
17+
deps =
18+
pre-commit
19+
commands =
20+
pre-commit install -f --install-hooks
21+
pre-commit run --all-files
22+
1523
[testenv:update]
1624
description = Update the tzdata contents
1725
skip_install = True
@@ -30,7 +38,6 @@ deps =
3038
commands =
3139
python bump_version.py {posargs}
3240

33-
3441
[testenv:pytype]
3542
description = Run typechecking
3643
basepython = python3.7

0 commit comments

Comments
 (0)