-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
61 lines (48 loc) · 1.46 KB
/
Makefile
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
51
52
53
54
55
56
57
58
59
60
61
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
# base path for Lexicon document tree (for lexgen)
LEXDIR?=../atproto/lexicons
# https://github.com/golang/go/wiki/LoopvarExperiment
export GOEXPERIMENT := loopvar
.PHONY: help
help: ## Print info about all commands
@echo "Commands:"
@echo
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[01;32m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## Build all executables
go build ./cmd/gosky
go build ./cmd/laputa
go build ./cmd/bigsky
go build ./cmd/beemo
go build ./cmd/lexgen
go build ./cmd/stress
go build ./cmd/fakermaker
go build ./cmd/hepa
go build ./cmd/supercollider
go build -o ./sonar-cli ./cmd/sonar
go build ./cmd/palomar
.PHONY: all
all: build
.PHONY: test
test: ## Run tests
go test ./...
.PHONY: coverage-html
coverage-html: ## Generate test coverage report and open in browser
go test ./... -coverpkg=./... -coverprofile=test-coverage.out
go tool cover -html=test-coverage.out
.PHONY: lint
lint: ## Verify code style and run static checks
go vet ./...
test -z $(gofmt -l ./...)
.PHONY: fmt
fmt: ## Run syntax re-formatting (modify in place)
go fmt ./...
.PHONY: check
check: ## Compile everything, checking syntax (does not output binaries)
go build ./...
.env:
if [ ! -f ".env" ]; then cp example.dev.env .env; fi
.PHONY: run-dev-automod
run-dev-automod: .env ## Runs automod for local dev
GOLOG_LOG_LEVEL=info go run ./cmd/automod run