diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-13 13:48:56 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-13 13:48:56 -0500 |
| commit | 997d839ca41b7a6fc46f3fba722476e6558688ab (patch) | |
| tree | 507d7fdcf75f79ffca5c7747aeaed7deb5a99126 | |
| parent | a8db4796820190d725789456a579d11da75382e5 (diff) | |
| download | chime-997d839ca41b7a6fc46f3fba722476e6558688ab.tar.gz chime-997d839ca41b7a6fc46f3fba722476e6558688ab.zip | |
fix: scope validate-el.sh hook to in-project files
The PostToolUse hook tried to byte-compile every .el file edited, including ones outside the chime project. Out-of-project files typically require packages that aren't on the hook's -L paths, so validation failed for unrelated reasons. Exit 0 when the edited file isn't under $PROJECT_ROOT.
| -rwxr-xr-x | .claude/hooks/validate-el.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/.claude/hooks/validate-el.sh b/.claude/hooks/validate-el.sh index 0c3a46c..db1770b 100755 --- a/.claude/hooks/validate-el.sh +++ b/.claude/hooks/validate-el.sh @@ -35,6 +35,13 @@ f="$(jq -r '.tool_input.file_path // .tool_response.filePath // empty')" [ -z "$f" ] && exit 0 [ "${f##*.}" = "el" ] || exit 0 +# Skip files outside the project — the hook's -L paths only cover this repo, +# so byte-compiling another project's .el will fail on its own requires. +case "$f" in + "$PROJECT_ROOT"/*) ;; + *) exit 0 ;; +esac + MAX_AUTO_TEST_FILES=20 # skip if more matches than this (large test suites) # --- Phase 1: syntax + byte-compile --- |
