From d27d07e8e4b004926ea960c118fa99caa979caa0 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 25 May 2026 14:50:31 -0500 Subject: fix(elisp): gitignore the full Claude tooling footprint The bundle tracked .claude/rules, CLAUDE.md, and githooks/, ignoring only the personal overrides. For a code project, especially a third-party package checkout, the whole Claude footprint should stay local: install and sync deliver it, so it shouldn't land in the project's history. gitignore-add.txt now ignores .claude/, CLAUDE.md, and githooks/ next to the elisp build artifacts. I also added install-lang.bats, which the bundle had no test for. It covers the landed footprint and the gitignore set. --- languages/elisp/gitignore-add.txt | 7 ++++--- scripts/tests/install-lang.bats | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 scripts/tests/install-lang.bats diff --git a/languages/elisp/gitignore-add.txt b/languages/elisp/gitignore-add.txt index 72d8290..42a1404 100644 --- a/languages/elisp/gitignore-add.txt +++ b/languages/elisp/gitignore-add.txt @@ -1,6 +1,7 @@ -# Claude Code — personal overrides (not part of the ruleset) -/.claude/settings.local.json -/.claude/.cache/ +# Claude Code — local tooling, delivered by install/sync, not committed +.claude/ +CLAUDE.md +githooks/ # Elisp byte-compile artifacts (generated by the hook) *.elc diff --git a/scripts/tests/install-lang.bats b/scripts/tests/install-lang.bats new file mode 100644 index 0000000..523be99 --- /dev/null +++ b/scripts/tests/install-lang.bats @@ -0,0 +1,42 @@ +#!/usr/bin/env bats +# +# Tests for scripts/install-lang.sh — install a language ruleset into a project. +# +# Strategy: scaffold a fresh git project in a temp dir, run install-lang.sh +# against it. Canonical source stays the real one (install-lang.sh resolves +# languages/ and claude-rules/ relative to its own location). + +REAL_REPO="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)" +INSTALL_LANG="$REAL_REPO/scripts/install-lang.sh" + +setup() { + PROJECT="$(mktemp -d -t install-lang-bats.XXXXXX)" + (cd "$PROJECT" && git init -q) +} + +teardown() { + rm -rf "$PROJECT" +} + +@test "install-lang elisp: lands the tooling footprint" { + run bash "$INSTALL_LANG" elisp "$PROJECT" + + [ "$status" -eq 0 ] + [ -d "$PROJECT/.claude/rules" ] + [ -d "$PROJECT/githooks" ] + [ -f "$PROJECT/CLAUDE.md" ] +} + +@test "install-lang elisp: gitignores the full Claude tooling footprint" { + run bash "$INSTALL_LANG" elisp "$PROJECT" + + [ "$status" -eq 0 ] + # The whole .claude/, CLAUDE.md, and githooks/ stay out of the project's + # git history — Claude tooling is delivered by install/sync, never committed. + grep -qxF ".claude/" "$PROJECT/.gitignore" + grep -qxF "CLAUDE.md" "$PROJECT/.gitignore" + grep -qxF "githooks/" "$PROJECT/.gitignore" + # Elisp byte-compile artifacts. + grep -qxF "*.elc" "$PROJECT/.gitignore" + grep -qxF "*.eln" "$PROJECT/.gitignore" +} -- cgit v1.2.3