github.com/marianogappa/goreleaser@v0.26.2-0.20170715090149-96acd0a9fc46/Makefile (about)

     1  SOURCE_FILES?=$$(go list ./... | grep -v /vendor/)
     2  TEST_PATTERN?=.
     3  TEST_OPTIONS?=
     4  
     5  setup: ## Install all the build and lint dependencies
     6  	go get -u github.com/alecthomas/gometalinter
     7  	go get -u github.com/golang/dep/cmd/dep
     8  	go get -u github.com/pierrre/gotestcover
     9  	go get -u golang.org/x/tools/cmd/cover
    10  	dep ensure
    11  	gometalinter --install
    12  
    13  test: ## Run all the tests
    14  	gotestcover $(TEST_OPTIONS) -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m
    15  
    16  cover: test ## Run all the tests and opens the coverage report
    17  	go tool cover -html=coverage.txt
    18  
    19  fmt: ## gofmt and goimports all go files
    20  	find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
    21  
    22  lint: ## Run all the linters
    23  	gometalinter --vendor --disable-all \
    24  		--enable=deadcode \
    25  		--enable=ineffassign \
    26  		--enable=gosimple \
    27  		--enable=staticcheck \
    28  		--enable=gofmt \
    29  		--enable=goimports \
    30  		--enable=dupl \
    31  		--enable=misspell \
    32  		--enable=errcheck \
    33  		--enable=vet \
    34  		--enable=vetshadow \
    35  		--deadline=10m \
    36  		./...
    37  
    38  ci: test lint  ## Run all the tests and code checks
    39  
    40  build: ## Build a beta version of goreleaser
    41  	go build
    42  
    43  # Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
    44  help:
    45  	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
    46  
    47  .DEFAULT_GOAL := build