- Fix .golangci.yml for v2 format (linters-settings -> linters.settings) - All production code now passes golangci-lint with zero issues - Line length 88, funlen 80/50, cyclop 15, dupl 100 - Extract shared helpers in db (scanChannels, scanInt64s, scanMessages) - Split runMigrations into applyMigration/execMigration - Fix fanOut return signature (remove unused int64) - Add fanOutSilent helper to avoid dogsled - Rewrite CLI code for lint compliance (nlreturn, wsl_v5, noctx, etc) - Rename CLI api package to chatapi to avoid revive var-naming - Fix all noinlineerr, mnd, perfsprint, funcorder issues - Fix db tests: extract helpers, add t.Parallel, proper error checks - Broker tests already clean - Handler integration tests still have lint issues (next commit)
21 lines
457 B
Makefile
21 lines
457 B
Makefile
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
|
LDFLAGS := -ldflags "-X main.Version=$(VERSION)"
|
|
|
|
.PHONY: build test clean docker lint
|
|
|
|
build:
|
|
go build $(LDFLAGS) -o chatd ./cmd/chatd/
|
|
go build $(LDFLAGS) -o chat-cli ./cmd/chat-cli/
|
|
|
|
test:
|
|
DBURL="file::memory:?cache=shared" go test ./...
|
|
|
|
clean:
|
|
rm -f chatd chat-cli
|
|
|
|
lint:
|
|
GOFLAGS=-buildvcs=false golangci-lint run ./...
|
|
|
|
docker:
|
|
docker build -t chat:$(VERSION) .
|