github.com/errata-ai/vale/v3@v3.4.2/Makefile (about) 1 LAST_TAG=$(shell git describe --abbrev=0 --tags) 2 CURR_SHA=$(shell git rev-parse --verify HEAD) 3 4 LDFLAGS=-ldflags "-s -w -X main.version=$(LAST_TAG)" 5 6 .PHONY: data test lint install rules setup bench compare release 7 8 all: build 9 10 # make release tag=v0.4.3 11 release: 12 git tag $(tag) 13 git push origin $(tag) 14 15 # If os and/or arch are not set, default values are used which are set by the system used for building 16 # make build os=darwin 17 # make build os=windows 18 # make build os=linux 19 # make build os=darwin arch=arm64 20 # make build os=windows arch=amd64 21 # make build os=linux arch=amd64 22 # make build os=linux arch=arm64 23 build: 24 GOOS=$(os) GOARCH=$(arch) go build ${LDFLAGS} -o bin/$(exe) ./cmd/vale 25 26 bench: 27 go test -bench=. -benchmem ./internal/core ./internal/lint ./internal/check 28 29 profile: 30 go test -benchmem -run=^$$ -bench ^BenchmarkLintMD$$ github.com/errata-ai/vale/v2/internal/lint -cpuprofile=bin/cpu.out -memprofile=bin/mem.out -trace=bin/trace.out 31 mv lint.test bin 32 33 # go install github.com/aclements/go-misc/benchmany@latest 34 # go install golang.org/x/tools/cmd/benchcmp@latest 35 # go install golang.org/x/perf/cmd/benchstat@latest 36 compare: 37 cd internal/lint && \ 38 benchmany -n 10 -o new.txt ${CURR_SHA} && \ 39 benchmany -n 10 -o old.txt ${LAST_TAG} && \ 40 benchstat old.txt new.txt 41 42 setup: 43 cd testdata && bundle install && cd - 44 45 test: 46 go test ./internal/core ./internal/lint ./internal/check ./internal/nlp ./internal/glob ./cmd/vale 47 cd testdata && cucumber --format progress && cd - 48 49 docker: 50 docker login -u jdkato -p ${DOCKER_PASS} 51 docker buildx build \ 52 --build-arg ltag=${LAST_TAG} \ 53 --platform=linux/amd64,linux/arm64 \ 54 --file Dockerfile \ 55 --tag jdkato/vale:${LAST_TAG} \ 56 --tag jdkato/vale:latest \ 57 --push \ 58 .