aboutsummaryrefslogtreecommitdiff
path: root/languages/elisp/claude
diff options
context:
space:
mode:
Diffstat (limited to 'languages/elisp/claude')
-rwxr-xr-xlanguages/elisp/claude/hooks/validate-el.sh1
-rw-r--r--languages/elisp/claude/scripts/coverage-summary.el10
2 files changed, 8 insertions, 3 deletions
diff --git a/languages/elisp/claude/hooks/validate-el.sh b/languages/elisp/claude/hooks/validate-el.sh
index 2529fcc..8e46457 100755
--- a/languages/elisp/claude/hooks/validate-el.sh
+++ b/languages/elisp/claude/hooks/validate-el.sh
@@ -104,6 +104,7 @@ if [ "$count" -ge 1 ] && [ "$count" -le "$MAX_AUTO_TEST_FILES" ]; then
-L "$PROJECT_ROOT/tests" \
-L "$PROJECT_ROOT/themes" \
--eval '(package-initialize)' \
+ --eval "(cd \"$PROJECT_ROOT/tests\")" \
-l ert "${load_args[@]}" \
--eval "(ert-run-tests-batch-and-exit '(not (tag :slow)))" 2>&1)"; then
# Terminal gets a compact summary (the run tally + the failing test names);
diff --git a/languages/elisp/claude/scripts/coverage-summary.el b/languages/elisp/claude/scripts/coverage-summary.el
index eb30c66..4b7f5c9 100644
--- a/languages/elisp/claude/scripts/coverage-summary.el
+++ b/languages/elisp/claude/scripts/coverage-summary.el
@@ -91,11 +91,15 @@ missing or malformed."
(defun cj/coverage-summary--source-files (source-dir project-root)
"Return *.el files directly under SOURCE-DIR, relative to PROJECT-ROOT.
-Sorted; compiled files and subdirectories are out of scope."
+Sorted. Compiled files and subdirectories are out of scope, as are generated
+package files (`*-autoloads.el', `*-pkg.el') -- a build tool writes those, no
+test covers them, and counting them as untested source skews the number."
(let ((source-dir (file-name-as-directory (expand-file-name source-dir)))
(project-root (file-name-as-directory (expand-file-name project-root))))
- (sort (mapcar (lambda (p) (file-relative-name p project-root))
- (directory-files source-dir t "\\.el\\'"))
+ (sort (seq-remove
+ (lambda (p) (string-match-p "\\(?:-autoloads\\|-pkg\\)\\.el\\'" p))
+ (mapcar (lambda (p) (file-relative-name p project-root))
+ (directory-files source-dir t "\\.el\\'")))
#'string<)))
(defun cj/coverage-summary--missing (tracked source-dir project-root)