forked from asheshgoplani/agent-deck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlefthook.yml
More file actions
50 lines (48 loc) · 2.58 KB
/
Copy pathlefthook.yml
File metadata and controls
50 lines (48 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Local CI pipeline
# Called automatically on git push (via pre-push hook) or manually: make ci
#
# pre-push runs serially (piped: true) to avoid a race between `css-verify`
# and `lint` on the transient internal/web/static/.brute-tw.src.css file —
# see issue #1146 and the comment on pre-push below.
#
# Usage:
# make ci Run full CI checks locally
# lefthook run pre-push --force Run directly (--force skips file-change check)
pre-push:
# piped: true runs the commands below in the order they appear and stops on
# the first failure. We need ordered execution (not parallel) because
# `css-verify` momentarily writes `internal/web/static/.brute-tw.src.css`
# while `golangci-lint` snapshots `//go:embed static/*` — ~30% of runs the
# snapshot caught the transient file and lint failed (issue #1146). Order
# is fast-failing-first: css-verify, lint, build, then the longer test.
piped: true
commands:
css-verify:
run: env -u GIT_DIR -u GIT_WORK_TREE -u GIT_COMMON_DIR -u GIT_INDEX_FILE -u GIT_OBJECT_DIRECTORY -u GIT_ALTERNATE_OBJECT_DIRECTORIES -u GIT_PREFIX make css-verify
tags: [quality, css]
lint:
run: env -u GIT_DIR -u GIT_WORK_TREE -u GIT_COMMON_DIR -u GIT_INDEX_FILE -u GIT_OBJECT_DIRECTORY -u GIT_ALTERNATE_OBJECT_DIRECTORIES -u GIT_PREFIX golangci-lint run
tags: [quality]
build:
run: env -u GIT_DIR -u GIT_WORK_TREE -u GIT_COMMON_DIR -u GIT_INDEX_FILE -u GIT_OBJECT_DIRECTORY -u GIT_ALTERNATE_OBJECT_DIRECTORIES -u GIT_PREFIX go build -o /dev/null ./cmd/agent-deck/
tags: [build]
test:
run: env -u GIT_DIR -u GIT_WORK_TREE -u GIT_COMMON_DIR -u GIT_INDEX_FILE -u GIT_OBJECT_DIRECTORY -u GIT_ALTERNATE_OBJECT_DIRECTORIES -u GIT_PREFIX go test -race -count=1 ./...
tags: [test]
release-tests-yaml-lint:
# Structural guard against the AP-2 foot-gun (sprint REPORT F2): inline
# `#NNN` issue refs inside plain multi-line scalars truncate via YAML
# comment rules and silently break any downstream `yaml.safe_load`.
# Matches the build-time TestManifestIsValidYAML guard.
run: python3 -c "import yaml; yaml.safe_load(open('.claude/release-tests.yaml'))"
tags: [quality, manifest]
# Fast pre-commit checks (formatting only, keeps commits snappy)
pre-commit:
parallel: true
commands:
fmt-check:
run: test -z "$(gofmt -l . | grep -v -E '^(\.worktrees/|\.claude/worktrees/)')" || (echo "Run 'go fmt ./...' to fix formatting" && gofmt -l . | grep -v -E '^(\.worktrees/|\.claude/worktrees/)' && exit 1)
tags: [quality]
vet:
run: go vet ./...
tags: [quality]