nandi/gleanpublic Fork 0
ee16641
Commits
Clone
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

ci: add crap scoreUnverified

Julien Robert committed 2026-07-15T13:16:09+02:00 Browse files
ee16641 parent: 368dd5f
modified .tangled/workflows/ci.yml +6 -0
@@ -25,8 +25,14 @@ steps:
2525 - name: "Install dependencies"
2626 command: "cd web && bun install"
2727
28+ - name: "Install Go tools"
29+ command: "make tools-install"
30+
2831 - name: "Build glean"
2932 command: "make build"
3033
3134 - name: "Run tests"
3235 command: "make test"
36+
37+ - name: "CRAP score analysis"
38+ command: "make crap"
@@ -25,8 +25,14 @@ steps:
25 - name: "Install dependencies"25 - name: "Install dependencies"
26 command: "cd web && bun install"26 command: "cd web && bun install"
27 27
28+ - name: "Install Go tools"
29+ command: "make tools-install"
30+
28 - name: "Build glean"31 - name: "Build glean"
29 command: "make build"32 command: "make build"
30 33
31 - name: "Run tests"34 - name: "Run tests"
32 command: "make test"35 command: "make test"
36+
37+ - name: "CRAP score analysis"
38+ command: "make crap"
modified Makefile +8 -0
@@ -5,6 +5,7 @@ export CGO_CFLAGS := -I$(CURDIR)/internal/db/include -I$(SQLITE3_INC)
55 .PHONY: tools-install
66 tools-install:
77 go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
8+ go install github.com/padiazg/go-crap@latest
89
910 .PHONY: lint
1011 lint:
@@ -64,6 +65,13 @@ lex-parse:
6465 test:
6566 go test -tags fts5 ./...
6667
68+# CRAP score analysis (cyclomatic complexity x coverage).
69+# The fts5 build tag is required for the test build, so it's exported via GOFLAGS
70+# for the underlying `go test -cover` run go-crap performs.
71+.PHONY: crap
72+crap:
73+ GOFLAGS=-tags=fts5 go-crap scan --fail-above --threshold 30
74+
6775 .PHONY: check
6876 check:
6977 cd web && bun run check
@@ -5,6 +5,7 @@ export CGO_CFLAGS := -I$(CURDIR)/internal/db/include -I$(SQLITE3_INC)
5 .PHONY: tools-install5 .PHONY: tools-install
6 tools-install:6 tools-install:
7 go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest7 go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
8+ go install github.com/padiazg/go-crap@latest
8 9
9 .PHONY: lint10 .PHONY: lint
10 lint:11 lint:
@@ -64,6 +65,13 @@ lex-parse:
64 test:65 test:
65 go test -tags fts5 ./...66 go test -tags fts5 ./...
66 67
68+# CRAP score analysis (cyclomatic complexity x coverage).
69+# The fts5 build tag is required for the test build, so it's exported via GOFLAGS
70+# for the underlying `go test -cover` run go-crap performs.
71+.PHONY: crap
72+crap:
73+ GOFLAGS=-tags=fts5 go-crap scan --fail-above --threshold 30
74+
67 .PHONY: check75 .PHONY: check
68 check:76 check:
69 cd web && bun run check77 cd web && bun run check