aboutsummaryrefslogtreecommitdiff
path: root/.claude
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 07:20:50 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 07:20:50 -0500
commit6045ba72c893a5718639217e4c25b948e7505cee (patch)
tree98bb4f7462ee4ac7d3dadb3c1768ca0932cbc25c /.claude
parent59b0854464ef29511a0d09f1e76fd1140e675833 (diff)
downloaddotemacs-6045ba72c893a5718639217e4c25b948e7505cee.tar.gz
dotemacs-6045ba72c893a5718639217e4c25b948e7505cee.zip
chore(hooks): eval load-prefer-newer before byte-compile and test runs
The validate-el.sh hook loaded stale `.elc` files when the matching `.el` was newer (e.g. after a sed-driven rename where the byte-compile hook never fires). `make test` already sets this. The hook didn't, so I added `(setq load-prefer-newer t)` to all three emacs invocations: the parens check, the byte-compile, and the test run.
Diffstat (limited to '.claude')
-rwxr-xr-x.claude/hooks/validate-el.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/.claude/hooks/validate-el.sh b/.claude/hooks/validate-el.sh
index 803badf8..dfb7ac7e 100755
--- a/.claude/hooks/validate-el.sh
+++ b/.claude/hooks/validate-el.sh
@@ -41,13 +41,16 @@ MAX_AUTO_TEST_FILES=20 # skip if more matches than this (large test suites)
case "$f" in
*/init.el|*/early-init.el)
# Byte-compile here would load the full package graph. Parens only.
- if ! output="$(emacs --batch --no-site-file --no-site-lisp "$f" \
+ if ! output="$(emacs --batch --no-site-file --no-site-lisp \
+ --eval '(setq load-prefer-newer t)' \
+ "$f" \
--eval '(check-parens)' 2>&1)"; then
fail_json "PAREN CHECK FAILED" "$f" "$output"
fi
;;
*.el)
if ! output="$(emacs --batch --no-site-file --no-site-lisp \
+ --eval '(setq load-prefer-newer t)' \
-L "$PROJECT_ROOT" \
-L "$PROJECT_ROOT/modules" \
-L "$PROJECT_ROOT/tests" \
@@ -89,6 +92,7 @@ if [ "$count" -ge 1 ] && [ "$count" -le "$MAX_AUTO_TEST_FILES" ]; then
load_args=()
for t in "${tests[@]}"; do load_args+=("-l" "$t"); done
if ! output="$(emacs --batch --no-site-file --no-site-lisp \
+ --eval '(setq load-prefer-newer t)' \
-L "$PROJECT_ROOT" \
-L "$PROJECT_ROOT/modules" \
-L "$PROJECT_ROOT/tests" \