-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
53 lines (39 loc) · 1.26 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
GOVENDOR_DIR := ./vendor
GO_PACKAGES := $(shell go list ./... | grep -v $(GOVENDOR_DIR) | sed 's_github.com/sclasen/swfsm_._')
AWS_SERVICES_DIR := $(GOVENDOR_DIR)/github.com/aws/aws-sdk-go/service
LIB_MOCKS_DIR := ./testing/mocks
MOCK_NOTE := "AUTO-GENERATED MOCK. DO NOT EDIT.\nUSE make mocks TO REGENERATE."
all: ready test
travis: tidy test
install:
go install ./...
forego:
go get github.com/ddollar/forego
test: install
go test ./...
test-aws: install forego
forego run go test
tidy:
go get golang.org/x/tools/cmd/goimports
test -z "$$(goimports -l -d $(GO_PACKAGES) | tee /dev/stderr)"
lint:
go get github.com/golang/lint/golint
test -z "$$(golint ./... | tee /dev/stderr)"
go vet ./...
imports:
go get golang.org/x/tools/cmd/goimports
goimports -w -d $(GO_PACKAGES)
fmt:
go fmt $(GO_PACKAGES)
ready: fmt imports tidy
# TODO: change back to https://github.com/vektra/mockery
# after https://github.com/vektra/mockery/pull/36 is merged
mockery:
go get -u github.com/ryanbrainard/mockery
go install github.com/ryanbrainard/mockery
mocks: mockery
@rm -rf $(LIB_MOCKS_DIR)
@mkdir $(LIB_MOCKS_DIR)
@for AS in $$(ls $(AWS_SERVICES_DIR)); do \
mockery -dir $(AWS_SERVICES_DIR)/$${AS}/$${AS}iface -all -output $(LIB_MOCKS_DIR) -note $(MOCK_NOTE); \
done