github.com/sethvargo/go-limiter@v1.0.0/Makefile (about) 1 GOFMT_FILES = $(shell go list -f '{{.Dir}}' ./...) 2 3 benchmarks: 4 @(cd benchmarks/ && go test -bench=. -benchmem -benchtime=1s ./...) 5 .PHONY: benchmarks 6 7 fmtcheck: 8 @command -v goimports > /dev/null 2>&1 || (cd tools/ && go install golang.org/x/tools/cmd/goimports@latest) 9 @CHANGES="$$(goimports -d $(GOFMT_FILES))"; \ 10 if [ -n "$${CHANGES}" ]; then \ 11 echo "Unformatted (run goimports -w .):\n\n$${CHANGES}\n\n"; \ 12 exit 1; \ 13 fi 14 @# Annoyingly, goimports does not support the simplify flag. 15 @CHANGES="$$(gofmt -s -d $(GOFMT_FILES))"; \ 16 if [ -n "$${CHANGES}" ]; then \ 17 echo "Unformatted (run gofmt -s -w .):\n\n$${CHANGES}\n\n"; \ 18 exit 1; \ 19 fi 20 .PHONY: fmtcheck 21 22 spellcheck: 23 @command -v misspell > /dev/null 2>&1 || (cd tools/ && go install github.com/client9/misspell/cmd/misspell@latest) 24 @misspell -locale="US" -error -source="text" **/* 25 .PHONY: spellcheck 26 27 staticcheck: 28 @command -v staticcheck > /dev/null 2>&1 || (cd tools/ && go install honnef.co/go/tools/cmd/staticcheck@latest) 29 @staticcheck -checks="all" -tests $(GOFMT_FILES) 30 .PHONY: staticcheck 31 32 test: 33 @go test \ 34 -count=1 \ 35 -shuffle=on \ 36 -short \ 37 -timeout=5m \ 38 -vet=all \ 39 ./... 40 .PHONY: test 41 42 test-acc: 43 @go test \ 44 -count=1 \ 45 -shuffle=on \ 46 -race \ 47 -timeout=10m \ 48 -vet=all \ 49 ./... 50 .PHONY: test-acc