Skip to content

Commit 03396b2

Browse files
authored
Merge pull request #27 from bakerkj/ci/transition-to-prek
ci: transition pre-commit to prek with built-in hooks
2 parents d534c73 + 12b1269 commit 03396b2

4 files changed

Lines changed: 27 additions & 27 deletions

File tree

.github/workflows/pre-commit.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/prek.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: prek
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
prek:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@v6.0.2
13+
# mypy is skipped here (the dedicated mypy.yaml workflow runs it with a
14+
# full HA dependency env).
15+
- uses: j178/prek-action@v2.0.4
16+
env:
17+
SKIP: no-commit-to-branch,mypy
18+
with:
19+
extra-args: --all-files

.pre-commit-config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v6.0.0
2+
- repo: builtin
43
hooks:
54
- id: no-commit-to-branch
65
args: ["--branch", "main"]
76
- id: trailing-whitespace
87
- id: end-of-file-fixer
8+
- id: fix-byte-order-marker
99
- id: check-yaml
1010
- id: check-json
11+
- id: check-toml
1112
- id: check-added-large-files
1213
- id: check-merge-conflict
14+
- id: check-case-conflict
15+
- id: check-illegal-windows-names
1316
- id: detect-private-key
1417
- id: check-executables-have-shebangs
1518
- id: check-shebang-scripts-are-executable

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ Commits must follow the
4040
release-please uses commit prefixes (`feat:`, `fix:`, etc.) to drive version
4141
bumps.
4242

43-
After cloning, install the pre-commit hooks **including the commit-msg hook**
44-
(the default `pre-commit install` only wires up pre-commit-stage hooks):
43+
After cloning, install the hooks **including the commit-msg hook** (the default
44+
`prek install` only wires up pre-commit-stage hooks):
4545

4646
```
47-
uvx pre-commit install --hook-type pre-commit --hook-type commit-msg
47+
uvx prek install --overwrite --hook-type pre-commit --hook-type commit-msg
4848
```
4949

5050
Without `--hook-type commit-msg`, malformed commit messages won't be caught

0 commit comments

Comments
 (0)