-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.27 KB
/
Copy pathMakefile
File metadata and controls
58 lines (44 loc) · 1.27 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
51
52
53
54
55
56
57
58
export GOBIN := $(PWD)/bin
export PATH := $(GOBIN):$(shell printenv PATH)
install-go:
goenv install -s $$(cat .go-version)
install-go-modules:
go mod tidy
install-tools:
mkdir -p bin
go install \
github.com/99designs/gqlgen \
golang.org/x/tools/cmd/goimports \
honnef.co/go/tools/cmd/staticcheck
# Use installation script for golangci-lint to avoid toolchain issues
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b ./bin v2.4.0
install-all: install-go install-go-modules install-tools
gqlgen:
gqlgen generate
go-imports:
goimports -w $$(find . -name "*.go")
staticcheck:
staticcheck github.com/Rusty-Alucard/sp_api/...
lint:
@if command -v /opt/homebrew/bin/golangci-lint >/dev/null 2>&1; then \
/opt/homebrew/bin/golangci-lint run; \
else \
golangci-lint run; \
fi
lint-fix:
@if command -v /opt/homebrew/bin/golangci-lint >/dev/null 2>&1; then \
/opt/homebrew/bin/golangci-lint run --fix; \
else \
golangci-lint run --fix; \
fi
test:
go test ./... -v
test-coverage:
go test ./... -v -coverprofile cover.txt -coverpkg=./...
go tool cover -html=cover.txt -o index.html
server:
go run server.go wire_gen.go
validate-ci:
circleci config validate
validate-all: validate-ci lint
@echo "All validations passed!"