Commit 447795b
authored
Add pre-commit for automated pre-push checks (#4660)
## Description / motivation
Versioned hook configuration and a single documented install path reduce
friction and drift between machines compared to copy-pasted shell hooks.
## How to test
1. `$ uv sync --group dev`
2. `$ uv run pre-commit install --hook-type pre-push`
3. Make any change, commit it, and push it
<img width="908" height="253" alt="image"
src="https://github.com/user-attachments/assets/d492e2a8-9f33-4adf-866e-04c54cbf57d9"
/>
### Details
- Add `.pre-commit-config.yaml` with a **pre-push** hook that runs
`./ninja check`
- Add `pre-commit` to the `dev` dependency group and refresh `uv.lock`.
- Update `docs/contributing.md`: contributors install hooks via `uv run
pre-commit` / `python -m pre_commit`, and drop the old suggestion of
manual `.git/hooks` scripts.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -1 parent 64386ca commit 447795b
File tree
5 files changed
+234
-9
lines changed- docs
- tools/minilints/src
5 files changed
+234
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | 105 | | |
108 | | - | |
109 | | - | |
110 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
112 | 124 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
0 commit comments