Commit ee679e7
committed
chore: harden pre-commit hook (tracked .githooks/ + core.hooksPath)
Replace the dev-shell installer that wrote .git/hooks/pre-commit with a
tracked .githooks/pre-commit wired via `git config core.hooksPath .githooks`.
Fixes three issues with the old hook: it gated on `[ -d .git ]` (false in
worktrees/submodules where .git is a file), it clobbered any existing
.git/hooks/pre-commit on every `nix develop`, and `nix fmt … || exit 0`
swallowed real formatter failures. The new hook skips only when `nix` is
absent (CI is the authoritative gate) and otherwise blocks on a `nix fmt`
failure or reformat.1 parent 10838df commit ee679e7
3 files changed
Lines changed: 23 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
68 | 54 | | |
69 | 55 | | |
70 | 56 | | |
| |||
0 commit comments