lens @ c8e1328164e9ffbd681c3c0e449f1e6b9856b896

 1BIN=img
 2OUT=./bin/$(BIN)
 3SERVER=./cmd/server/main.go
 4
 5GO_TEST=go test -v -timeout 100ms -shuffle on -parallel `nproc`
 6GO_BUILD=go build -v
 7GO_RUN=go run -v
 8
 9all: build sass
10
11build:
12	$(GO_BUILD) -o $(OUT) $(SERVER)
13
14run: sass
15	$(GO_RUN) $(SERVER)
16
17sass:
18	@mkdir -p static
19	sassc \
20		-I scss scss/main.scss static/main.css \
21		--style compressed
22
23test: test.unit test.integration
24
25test.all: gci test.unit test.integration lint
26
27test.integration:
28	$(GO_TEST) -tags=integration ./...
29
30test.unit:
31	$(GO_TEST) -tags=unit ./...
32
33gen:
34	go run -v \
35		./cmd/ggen/...
36
37cover.%:
38	$(GO_TEST) \
39		-tags=$* \
40		-coverprofile=bin/cover \
41		./...
42	go tool cover \
43		-html=bin/cover \
44		-o bin/cover.html
45	echo "open bin/cover.html"
46
47lint:
48	golangci-lint run \
49	--fix \
50	--config golangci.yml \
51	--verbose \
52	./...
53
54gci:
55	find . \
56		-type f \
57		-name "*.go" \
58		-not -path "./vendor/*" \
59		-exec gci write -s standard -s default -s "prefix(git.sr.ht/~gabrielgio/img)" {} +