Commit 841f0f3
chore(hooks): scope pre-edit-impact to cqs's own src/ and tests/ (#1068)
The hook was matching any path containing `/src/`, which included
vendored Rust subtrees like `cuvs-fork-push/rust/cuvs/src/`. When an Edit
fired against a cuvs file, the hook tried to invoke
`python3 .claude/hooks/pre-edit-impact.py` with cwd=cuvs-fork-push,
where that path doesn't exist — silently blocking the Edit with a
'No such file' error. Hit during today's rebase of rapidsai/cuvs#2019
to resolve a merge conflict; had to work around by writing the file via
a Python script in Bash.
Tighten the path predicate: derive cqs root from the script's own
location, then accept only files under `<cqs_root>/src/` or
`<cqs_root>/tests/`. cuvs-fork-push, evals/, samples/, and any future
vendored Rust subtree all silently bail.
Verified with four smoke cases:
- cuvs path → exit 0, no `cqs impact` invocation
- cqs/src path → exit 0, runs `cqs impact` (no output for hypothetical fns)
- cqs/tests path → exit 0, runs `cqs impact`
- cqs/evals/*.rs → exit 0, no invocation (not under src/ or tests/)
Co-authored-by: jamie8johnson <jamie8johnson@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d290f23 commit 841f0f3
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
7 | 15 | | |
8 | 16 | | |
9 | 17 | | |
| |||
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
18 | | - | |
19 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
20 | 39 | | |
21 | 40 | | |
22 | 41 | | |
| |||
0 commit comments