github.com/FollowTheProcess/tag@v0.4.2/Makefile (about) 1 .PHONY: help tidy fmt test lint cover clean check sloc gen build install uninstall 2 .DEFAULT_GOAL := help 3 4 help: ## Show the list of available tasks 5 @echo "Available Tasks:\n" 6 @grep -E '^[a-zA-Z_0-9%-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-10s %s\n", $$1, $$2}' 7 8 tidy: ## Tidy dependencies in go.mod 9 go mod tidy 10 11 fmt: ## Run go fmt on all source files 12 go fmt ./... 13 14 test: ## Run the test suite 15 go test -race ./... 16 17 lint: ## Run the linters and auto-fix if possible 18 golangci-lint run --fix 19 20 clean: ## Remove build artifacts and other clutter 21 go clean ./... 22 rm -rf ./bin ./dist 23 24 check: test lint ## Run tests and linting in one go 25 26 sloc: ## Print lines of code (for fun) 27 find . -name "*.go" | xargs wc -l | sort -nr | head 28 29 gen: ## Run go generate 30 go generate ./... 31 32 build: gen ## Compile the project binary 33 mkdir -p ./bin 34 goreleaser build --single-target --skip-before --snapshot --clean --output ./bin/tag 35 36 install: uninstall build ## Install the project on your machine 37 cp ./bin/tag ${GOBIN} 38 39 uninstall: ## Uninstall the project from your machine 40 rm -rf ${GOBIN}/tag