-
Notifications
You must be signed in to change notification settings - Fork 82
/
Makefile
47 lines (38 loc) · 1.62 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
CONTEXT?=dev
REPLACE?=-replace flamingo.me/flamingo/v3=../flamingo -replace flamingo.me/form=../form
DROPREPLACE?=-dropreplace flamingo.me/flamingo/v3 -dropreplace flamingo.me/form
.PHONY: local unlocal test lint
local:
git config filter.gomod-flamingo-commerce.smudge 'go mod edit -fmt -print $(REPLACE) /dev/stdin'
git config filter.gomod-flamingo-commerce.clean 'go mod edit -fmt -print $(DROPREPLACE) /dev/stdin'
git config filter.gomod-flamingo-commerce.required true
go mod edit -fmt $(REPLACE)
unlocal:
git config filter.gomod-flamingo-commerce.smudge ''
git config filter.gomod-flamingo-commerce.clean ''
git config filter.gomod-flamingo-commerce.required false
go mod edit -fmt $(DROPREPLACE)
test:
go test -race -v ./...
gofmt -l -e -d .
golint ./...
misspell -error .
ineffassign .
integrationtest:
go test -test.count=10 -race -v ./test/integrationtest/... -tags=integration
generate-integrationtest-graphql:
rm -f test/integrationtest/projecttest/graphql/generated.go
rm -f test/integrationtest/projecttest/graphql/resolver.go
go generate ./...
export RUN="0" && cd test/integrationtest/projecttest && go run -tags graphql main.go
fix:
gofmt -l -w .
run-integrationtest-demo-project:
cd test/integrationtest/projecttest/tests && RUN=1 INTEGRATION_TEST_PORT=10000 go run ../main.go
lint:
$(eval FIRST_COMMIT = $(shell git rev-list --topo-order origin/master..HEAD | tail -1))
@echo FIRST_COMMIT=$(FIRST_COMMIT)
$(eval FIRST_COMMIT = $(or $(FIRST_COMMIT), "origin/master"))
@echo "FIRST_COMMIT is now $(FIRST_COMMIT)"
$(eval REV=$(shell git rev-parse $(FIRST_COMMIT)^1))
golangci-lint run --new-from-rev=$(REV)