aboutsummaryrefslogtreecommitdiff
path: root/languages
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-04-19 12:44:29 -0500
committerCraig Jennings <c@cjennings.net>2026-04-19 12:44:29 -0500
commit42086f187958249afc61c7eaa1c10e4ebbfd9238 (patch)
treead74780970116c0a2666010ecc81ad09d83031f8 /languages
parentbd6881adbe25272278031b419bedd5811ef3828c (diff)
downloadrulesets-42086f187958249afc61c7eaa1c10e4ebbfd9238.tar.gz
rulesets-42086f187958249afc61c7eaa1c10e4ebbfd9238.zip
fix(elisp): call package-initialize so byte-compile finds deps
Byte-compile needs external packages on the load path to resolve (require ...) forms in project files. Without this, any project using MELPA/ELPA packages (dash, s, etc.) failed Phase 1 with "Cannot open load file". package-initialize reads package-user-dir (default ~/.emacs.d/elpa) and exposes installed package autoloads. Small latency cost (~100ms) but makes the hook work on real projects. Verified: - chime.el (requires dash) now byte-compiles cleanly; was failing. - emacs.d modules still pass; no regression.
Diffstat (limited to 'languages')
-rwxr-xr-xlanguages/elisp/claude/hooks/validate-el.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/languages/elisp/claude/hooks/validate-el.sh b/languages/elisp/claude/hooks/validate-el.sh
index 956feaa..6f93d48 100755
--- a/languages/elisp/claude/hooks/validate-el.sh
+++ b/languages/elisp/claude/hooks/validate-el.sh
@@ -34,6 +34,7 @@ case "$f" in
-L "$PROJECT_ROOT" \
-L "$PROJECT_ROOT/modules" \
-L "$PROJECT_ROOT/tests" \
+ --eval '(package-initialize)' \
"$f" \
--eval '(check-parens)' \
--eval "(or (byte-compile-file \"$f\") (kill-emacs 1))" 2>&1)"; then
@@ -75,6 +76,7 @@ if [ "$count" -ge 1 ] && [ "$count" -le "$MAX_AUTO_TEST_FILES" ]; then
-L "$PROJECT_ROOT" \
-L "$PROJECT_ROOT/modules" \
-L "$PROJECT_ROOT/tests" \
+ --eval '(package-initialize)' \
-l ert "${load_args[@]}" \
--eval "(ert-run-tests-batch-and-exit '(not (tag :slow)))" 2>&1)"; then
printf 'TESTS FAILED for %s (%d test file(s)):\n%s\n' "$f" "$count" "$output" >&2