forked from errata-ai/vale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·94 lines (72 loc) · 2.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
LAST_TAG=$(shell git describe --abbrev=0 --tags)
CURR_SHA=$(shell git rev-parse --verify HEAD)
LDFLAGS=-ldflags "-s -w -X main.version=$(LAST_TAG)"
BUILD_DIR=./builds
.PHONY: data test lint install rules setup bench compare release
all: build
# make release tag=v0.4.3
release:
git tag $(tag)
git push origin $(tag)
# make build os=darwin exe=vale
# make build os=windows exe=vale.exe
# make build os=linux exe=vale
build:
GOOS=$(os) GOARCH=amd64 go build ${LDFLAGS} -o bin/$(exe)
install:
go install ${LDFLAGS}
spell:
./bin/vale --glob='!*{Needless,Diacritical,DenizenLabels,AnimalLabels}.yml' rule styles
bench:
go test -bench=. -benchmem ./core ./lint ./check
compare:
cd lint && \
benchmany -n 5 -o new.txt ${CURR_SHA} && \
benchmany -n 5 -o old.txt ${LAST_TAG} && \
benchcmp old.txt new.txt && \
benchstat old.txt new.txt
lint:
gometalinter --vendor --disable-all \
--enable=deadcode \
--enable=ineffassign \
--enable=gosimple \
--enable=staticcheck \
--enable=goimports \
--enable=dupl \
--enable=misspell \
--enable=errcheck \
--enable=vet \
--enable=vetshadow \
--deadline=1m \
./core ./lint ./ui ./check
setup:
go get golang.org/x/perf/cmd/benchstat
go get golang.org/x/tools/cmd/benchcmp
go get github.com/aclements/go-misc/benchmany
go get -u github.com/jteeuwen/go-bindata/...
bundle install
gem specific_install -l https://github.com/jdkato/aruba.git -b d-win-fix
rules:
go-bindata -ignore=\\.DS_Store -pkg="rule" -o rule/rule.go rule/**/*.yml
data:
go-bindata -ignore=\\.DS_Store -pkg="data" -o data/data.go data/*.{dic,aff}
test:
go test -race ./core ./lint ./check
cucumber
docker:
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/vale
docker login -u jdkato -p ${DOCKER_PASS}
docker build -f Dockerfile -t jdkato/vale:latest .
docker tag jdkato/vale:latest jdkato/vale:${LAST_TAG}
docker push jdkato/vale
cross:
mkdir -p $(BUILD_DIR)
GOOS=linux GOARCH=amd64 go build ${LDFLAGS}
tar -czvf "$(BUILD_DIR)/vale_$(LAST_TAG)_Linux_64-bit.tar.gz" ./vale
rm -rf vale
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS}
tar -czvf "$(BUILD_DIR)/vale_$(LAST_TAG)_macOS_64-bit.tar.gz" ./vale
rm -rf vale
GOOS=windows GOARCH=amd64 go build ${LDFLAGS}
zip -r "$(BUILD_DIR)/vale_$(LAST_TAG)_Windows_64-bit.zip" ./vale.exe
rm -rf vale.exe