This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
forked from errata-ai/vale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·64 lines (50 loc) · 1.66 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
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)"
.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)
# If os and/or arch are not set, default values are used which are set by the system used for building
# make build os=darwin
# make build os=windows
# make build os=linux
# make build os=darwin arch=arm64
# make build os=windows arch=amd64
# make build os=linux arch=amd64
# make build os=linux arch=arm64
build:
GOOS=$(os) GOARCH=$(arch) go build ${LDFLAGS} -o bin/$(exe) ./cmd/vale
arm:
GOOS=darwin GOARCH=arm64 go build ${LDFLAGS} -o bin/$(exe) ./cmd/vale
closed:
GOOS=$(os) GOARCH=amd64 go build -tags closed ${LDFLAGS} -o bin/$(exe) ./cmd/vale
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
setup:
cd testdata && bundle install && cd -
rules:
go-bindata -ignore=\\.DS_Store -pkg="rule" -o rule/rule.go rule/**/*.yml
data:
go-bindata -ignore=\\.DS_Store -pkg="spell" -o pkg/spell/data.go pkg/spell/data/*.{dic,aff}
test:
go test ./internal/core ./internal/lint ./internal/check ./internal/nlp ./pkg/glob
cd testdata && cucumber --format progress && cd -
docker:
docker login -u jdkato -p ${DOCKER_PASS}
docker buildx build \
--build-arg ltag=${LAST_TAG} \
--platform=linux/amd64,linux/arm64 \
--file Dockerfile \
--tag jdkato/vale:${LAST_TAG} \
--tag jdkato/vale:latest \
--push \
.