forked from goadesign/gorma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (45 loc) · 1.4 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
#! /usr/bin/make
#
# Makefile for gorma
#
# Targets:
# - "lint" runs the linter and checks the code format using goimports
# - "test" runs the tests
#
# Meta targets:
# - "all" is the default target, it runs all the targets in the order above.
#
DIRS=$(shell go list -f {{.Dir}} ./... | grep -v /example)
DEPEND=\
github.com/goadesign/goa/... \
github.com/goadesign/goa.design/tools/mdc \
github.com/golang/lint/golint \
github.com/onsi/ginkgo \
github.com/onsi/ginkgo/ginkgo \
github.com/onsi/gomega \
github.com/jinzhu/inflection \
github.com/kr/pretty \
golang.org/x/tools/cmd/goimports
.PHONY: goagen
all: depend lint test
docs:
@go get -v github.com/spf13/hugo
@cd /tmp && git clone https://github.com/goadesign/goa.design && cd goa.design && rm -rf content/reference public && make docs && hugo
@rm -rf public
@mv /tmp/goa.design/public public
@rm -rf /tmp/goa.design
depend:
@export GO111MODULE=on && go get -v github.com/goadesign/goa.design/tools/godoc2md
@go get -v $(DEPEND)
@go install $(DEPEND)
lint:
@for d in $(DIRS) ; do \
if [ "`goimports -l $$d/*.go | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
echo "^ - Repo contains improperly formatted go files" && echo && exit 1; \
fi \
done
@if [ "`golint ./... | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
echo "^ - Lint errors!" && echo && exit 1; \
fi
test:
@ginkgo -r --failOnPending --race -skipPackage vendor