aboutsummaryrefslogtreecommitdiff
path: root/scripts/install-lang.sh
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-31 11:43:03 -0500
committerCraig Jennings <c@cjennings.net>2026-05-31 11:43:03 -0500
commitb46619cd17ed4e36f2e59c1b600078521b2049ef (patch)
treef128aeef3f0f679a400595c896a98618266706d9 /scripts/install-lang.sh
parent3640664e0fa11d7eb99c2900df57734b411e2d2b (diff)
downloadrulesets-b46619cd17ed4e36f2e59c1b600078521b2049ef.tar.gz
rulesets-b46619cd17ed4e36f2e59c1b600078521b2049ef.zip
feat(elisp): add coverage-summary to the Elisp bundle with missing-file detection
A line-weighted coverage total has a blind spot: a module no test loads never shows up in the SimpleCov report, so it can't drag the number down. The suite looks healthier than it is. This adds a summary that counts every source file on disk against the report and treats an absent file as 0%, weighting the project number by file instead of by line so untested modules stay visible. The script ships at languages/elisp/claude/scripts/coverage-summary.el, self-contained on stock Emacs (just the built-in json). It parses the undercover SimpleCov shape directly rather than depending on the editor's coverage engine, so it runs anywhere the bundle lands. I proved it against a real 103-file report: 93 tracked, 27 untested modules surfaced, project number 66.4%. Delivery follows the bundle convention. The script lives under the gitignored .claude/ footprint and gets auto-fixed on drift by sync-language-bundle.sh, which I made generic for any claude/scripts/* rather than coverage-specific. The Makefile targets ship as a project-owned fragment (languages/elisp/coverage-makefile.txt) that install-lang.sh seeds at the project root and sync drops into .ai/inbox/ when that convention exists. The bundle never edits the project's own Makefile. Tests: 12 ERT for the kernel (Normal/Boundary/Error per function), wired into make test via a new languages/*/tests/ discovery path, plus bats for the sync auto-fix and the inbox-drop guards. This is the Elisp pilot. The pattern is proven, so fanning out to Python, Go, and TypeScript is now a follow-up. Each one needs only its own parser and fragment. The plumbing is already generic.
Diffstat (limited to 'scripts/install-lang.sh')
-rwxr-xr-xscripts/install-lang.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/install-lang.sh b/scripts/install-lang.sh
index 4097bde..0fc9ea8 100755
--- a/scripts/install-lang.sh
+++ b/scripts/install-lang.sh
@@ -76,6 +76,17 @@ if [ -f "$SRC/CLAUDE.md" ]; then
fi
fi
+# 3b. coverage-makefile.txt — project-owned Makefile fragment, seed on first
+# install. Never overwrites (the project edits its own copy) unless FORCE=1.
+if [ -f "$SRC/coverage-makefile.txt" ]; then
+ if [ -f "$PROJECT/coverage-makefile.txt" ] && [ "$FORCE" != "1" ]; then
+ echo " [skip] coverage-makefile.txt already exists (use FORCE=1 to overwrite)"
+ else
+ cp "$SRC/coverage-makefile.txt" "$PROJECT/coverage-makefile.txt"
+ echo " [ok] coverage-makefile.txt installed (copy its targets into your Makefile)"
+ fi
+fi
+
# 4. .gitignore — append missing lines (deduped, skip comments)
if [ -f "$SRC/gitignore-add.txt" ]; then
touch "$PROJECT/.gitignore"