/
Makefile
58 lines (46 loc) · 1.29 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
GO_FOLDERS=./chiapi/... ./pkg/...
pre-commit: go-test go-lint go-dep-ensure go-doc
commit:
@git cz
setup:
@go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
@echo "#!/bin/bash\ncat \$$1 | commitlint" > .git/hooks/commit-msg
@chmod +x .git/hooks/commit-msg
@dep init
utilities:
@go get -u github.com/robertkrimen/godocdown/godocdown
@npm install -g eslint
@npm install -g \
commitizen \
cz-conventional-changelog \
@commitlint/prompt-cli \
@commitlint/config-conventional
@npm install -g \
semantic-release \
@semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
@semantic-release/changelog \
@semantic-release/git
go-test:
@go test $(GO_FOLDERS)
go-lint:
@golangci-lint run \
--exclude-use-default=false --disable-all \
--enable golint --enable gosec --enable interfacer --enable unconvert \
--enable goimports --enable goconst --enable gocyclo --enable misspell \
--enable scopelint \
$(GO_FOLDERS)
go-dep-ensure:
@dep ensure
go-doc:
@gfind -type d -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | \
grep -v '^\.' | \
grep -v '\/\.' | \
grep -v '^pkg$$' | \
grep -v '^vendor' | \
xargs -I{} bash -c "godocdown {} > {}/README.md"
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
exit 1; \
fi