aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-23 19:34:07 -0400
committerCraig Jennings <c@cjennings.net>2026-06-23 19:34:07 -0400
commita936e081b7270fbd4f1e7e9cb67ca1d4c2291ce6 (patch)
treed4708d9fa7c2f70adf320c4e984f2b593cda93d4
parent266fc90ecfc5419c2a927d93c70239f1d2fade63 (diff)
downloaddotemacs-a936e081b7270fbd4f1e7e9cb67ca1d4c2291ce6.tar.gz
dotemacs-a936e081b7270fbd4f1e7e9cb67ca1d4c2291ce6.zip
chore(coverage): exclude generated autoloads and pkg files from summary
-rw-r--r--.claude/scripts/coverage-summary.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/.claude/scripts/coverage-summary.el b/.claude/scripts/coverage-summary.el
index eb30c6633..4b7f5c9c2 100644
--- a/.claude/scripts/coverage-summary.el
+++ b/.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)