diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-02 18:22:11 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-02 18:22:11 -0500 |
| commit | 3a06aff7eec20814f6b51b72691f4140668189c2 (patch) | |
| tree | 0dcfde239685ebeabea3ce941317f1dac5be8349 /languages/go/claude/settings.json | |
| parent | 0b07c15fb33ceaeec484dec9889c37098ec2e844 (diff) | |
| download | rulesets-3a06aff7eec20814f6b51b72691f4140668189c2.tar.gz rulesets-3a06aff7eec20814f6b51b72691f4140668189c2.zip | |
feat(go): build out the full Go language bundle
The Go bundle was coverage-slice-only. Because it shipped no rule files, sync-language-bundle.sh (which fingerprints a project's bundle by spotting one of its rule files in .claude/rules/) couldn't detect it, so the coverage slice it did ship never stayed in sync. Adding the rules is what makes the bundle sync-maintainable, which was the point.
Brought Go to the full tier, matching elisp:
- claude/rules/go.md and go-testing.md, the style and testing rules (table-driven tests, go test -race, errors.Is over message matching, how the coverage slice fits). These two are also the sync fingerprint.
- claude/hooks/validate-go.sh, a PostToolUse hook that runs gofmt and go vet on each edited .go file. go vet type-checks, so compile and syntax errors surface at edit time. It deliberately doesn't auto-run tests, since a package's tests can be slow or integration-tagged and shouldn't fire on every keystroke.
- claude/settings.json, Go permissions plus the hook wiring.
- githooks/pre-commit, a secret scan and a gofmt check on staged .go.
- CLAUDE.md, the seed.
validate-go.sh is TDD'd by scripts/tests/validate-go.bats: a clean file passes, gofmt and vet failures both block with the JSON payload, and non-go, missing, or empty paths are ignored. I updated install-lang.bats test 7, which asserted Go installs no CLAUDE.md, to check the full bundle instead. Verified with a real install into a throwaway project and a green make test.
Diffstat (limited to 'languages/go/claude/settings.json')
| -rw-r--r-- | languages/go/claude/settings.json | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/languages/go/claude/settings.json b/languages/go/claude/settings.json new file mode 100644 index 0000000..1bd333a --- /dev/null +++ b/languages/go/claude/settings.json @@ -0,0 +1,85 @@ +{ + "attribution": { + "commit": "", + "pr": "" + }, + "permissions": { + "allow": [ + "Bash(make)", + "Bash(make help)", + "Bash(make targets)", + "Bash(make test)", + "Bash(make test *)", + "Bash(make coverage)", + "Bash(make coverage-summary)", + "Bash(make lint)", + "Bash(make build)", + "Bash(go build)", + "Bash(go build *)", + "Bash(go test)", + "Bash(go test *)", + "Bash(go vet)", + "Bash(go vet *)", + "Bash(go run *)", + "Bash(go list *)", + "Bash(go env)", + "Bash(go env *)", + "Bash(go version)", + "Bash(go mod tidy)", + "Bash(go mod verify)", + "Bash(go mod download)", + "Bash(go tool cover *)", + "Bash(gofmt *)", + "Bash(gofumpt *)", + "Bash(staticcheck *)", + "Bash(golangci-lint run *)", + "Bash(git status)", + "Bash(git status *)", + "Bash(git diff)", + "Bash(git diff *)", + "Bash(git log)", + "Bash(git log *)", + "Bash(git show)", + "Bash(git show *)", + "Bash(git blame *)", + "Bash(git branch)", + "Bash(git branch -v)", + "Bash(git branch -a)", + "Bash(git branch --list *)", + "Bash(git remote)", + "Bash(git remote -v)", + "Bash(git remote show *)", + "Bash(git ls-files *)", + "Bash(git rev-parse *)", + "Bash(git cat-file *)", + "Bash(git stash list)", + "Bash(git stash show *)", + "Bash(jq *)", + "Bash(date)", + "Bash(date *)", + "Bash(which *)", + "Bash(file *)", + "Bash(ls)", + "Bash(ls *)", + "Bash(wc *)", + "Bash(du *)", + "Bash(readlink *)", + "Bash(realpath *)", + "Bash(basename *)", + "Bash(dirname *)" + ] + }, + "hooks": { + "PostToolUse": [ + { + "matcher": "Edit|Write|MultiEdit", + "hooks": [ + { + "type": "command", + "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/validate-go.sh" + } + ] + } + ] + } +} |
