aboutsummaryrefslogtreecommitdiff
path: root/languages/elisp/claude/scripts/coverage-summary.el
diff options
context:
space:
mode:
Diffstat (limited to 'languages/elisp/claude/scripts/coverage-summary.el')
-rw-r--r--languages/elisp/claude/scripts/coverage-summary.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/languages/elisp/claude/scripts/coverage-summary.el b/languages/elisp/claude/scripts/coverage-summary.el
index eb30c66..ed7ecfc 100644
--- a/languages/elisp/claude/scripts/coverage-summary.el
+++ b/languages/elisp/claude/scripts/coverage-summary.el
@@ -11,8 +11,15 @@
;; by file rather than by line, so untested modules are visible.
;;
;; Self-contained on purpose — it ships into a project's =.claude/scripts/= and
-;; must run with nothing but stock Emacs (`json' is built in). The SimpleCov
-;; JSON shape it parses is:
+;; must run with nothing but stock Emacs (`json' is built in).
+;;
+;; Local-only helper (Craig, 2026-06-28). =.claude/scripts/= is gitignored in
+;; code projects, so this file is not tracked and CI cannot run
+;; `make coverage-summary' against it. That is intentional: it stays a
+;; developer-run helper, not shipped to a tracked =scripts/= dir and not a CI
+;; gate. A gitignored install here is the design, not a coverage gap.
+;;
+;; The SimpleCov JSON shape it parses is:
;; { <suite>: { "coverage": { <abs-path>: [null | 0 | int, ...] } } }
;; where a null entry is a non-executable line, 0 is executable-but-unhit, and
;; any positive integer is a hit. Data unions across multiple suite keys.
@@ -91,11 +98,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)