1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-10-01 19:01:17 +02:00
nfpm/Makefile
Carlos Alexandro Becker 3c679196cd
fix: fixed example config
closes #31
2018-04-10 14:29:44 -03:00

68 lines
1.4 KiB
Makefile

SOURCE_FILES?=./...
TEST_PATTERN?=.
TEST_OPTIONS?=
# Install all the build and lint dependencies
setup:
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/caarlos0/bandep
go get -u gopkg.in/alecthomas/gometalinter.v2
ifeq ($(OS), Darwin)
brew install dep
else
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif
dep ensure
gometalinter.v2 --install
echo "make check" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
.PHONY: setup
check:
bandep --ban github.com/tj/assert
.PHONY: check
# Run all the tests
test:
go test $(TEST_OPTIONS) -v -coverpkg=./... -race -failfast -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=5m
.PHONY: cover
# Run all the tests and opens the coverage report
cover: test
go tool cover -html=coverage.txt
.PHONY: cover
# gofmt and goimports all go files
fmt:
find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
.PHONY: fmt
# Run all the linters
lint:
gometalinter.v2 --vendor ./...
.PHONY: lint
# Run all the tests and code checks
ci: build test lint
.PHONY: ci
# Build a beta version of goreleaser
build:
go generate ./...
go build
.PHONY: build
# Show to-do items per file.
todo:
@grep \
--exclude-dir=vendor \
--exclude-dir=node_modules \
--exclude=Makefile \
--text \
--color \
-nRo -E ' TODO:.*|SkipNow' .
.PHONY: todo
.DEFAULT_GOAL := build