Files
yellowjacket/lefthook.yml
T
logan 0b7ffd5679 build: check that css template literals were not ended by a comment
A backtick inside a comment in a css`` literal ends the literal. It has
cost four sessions across three plans, it is written down in CLAUDE.md,
the skill and NOTES.md, and it was read twice in the session it then
cost a cycle in. Knowledge that has been ignored three times is not a
knowledge problem.

The expense is the report, not the mistake: the literal ends early, the
rest of the CSS parses as JavaScript, and tsc says 'Class static side
incorrectly extends base class static side' pointing at a line of prose
-- or, in a shared module, every test in the suite fails to import and
the output reads like a broken test runner. make dev-headless mean-
while keeps serving the last good bundle.

Detection is exact rather than heuristic: if a backtick in a comment
closed the literal early, the text the parser took as the literal
contains an unterminated /*. Nothing else produces that. Verified both
ways -- clean on the tree, and red on a deliberately broken comment.
2026-08-13 01:07:08 -04:00

74 lines
2.1 KiB
YAML

# lefthook.yml — local git hooks for yellowjacket
# Install with: lefthook install
# Docs: https://github.com/evilmartians/lefthook
# Conventional Commits. CI runs the same script over every commit in a
# push, so skipping this locally only defers the failure.
commit-msg:
commands:
commit-check:
run: ./scripts/commit-check.sh {1}
pre-commit:
parallel: true
commands:
go-vet:
glob: "*.go"
run: go vet -tags webkit2_41 ./...
golangci-lint:
glob: "*.go"
run: go tool golangci-lint run --timeout 5m --build-tags webkit2_41 ./...
codegen-check:
glob: "*.{go,sql,templ}"
run: |
go generate ./...
if [ -n "$(git diff --name-only)" ]; then
echo "Generated code is out of date. Run 'make generate' and stage the changes."
git diff --stat
exit 1
fi
# frontend/wailsjs is generated by `wails`, not `go generate`, so the
# check above does not cover it. Takes ~1.5s.
bindings-check:
glob: "*.go"
run: ./scripts/bindings-check.sh
# .pi/ documents make targets; a stale one sends an agent off a
# cliff with total confidence. Instant.
skill-check:
glob: "{Makefile,.pi/**/*.md}"
run: ./scripts/skill-check.sh
frontend-typecheck:
glob: "frontend/**/*.{ts,tsx}"
root: "frontend/"
run: ./node_modules/.bin/tsc --noEmit
# A backtick in a comment inside a css`` literal ends the literal.
# tsc does catch it, as "Class static side incorrectly extends base
# class static side" pointing at a line of prose; this says what
# actually happened. Instant.
css-literals:
glob: "frontend/**/*.ts"
root: "frontend/"
run: node scripts/check-css-literals.mjs
pre-push:
parallel: true
commands:
go-test:
glob: "*.go"
run: go test -tags webkit2_41 -race -count=1 -timeout 120s ./...
go-mod-verify:
run: go mod verify
# The component and store tier: a real browser, no app. ~2s.
ui-test:
glob: "frontend/**/*.ts"
root: "frontend/"
run: ./node_modules/.bin/vitest run