Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make: add golangci-lint and nilaway targets #26

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# vim: ts=4 sw=4 ft=make

MAKEFILE_PATH := $(realpath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(abspath $(dir $(MAKEFILE_PATH)))

GOBIN = $(MAKEFILE_DIR)/bin

.PHONY: all
all: test test_build

Expand Down Expand Up @@ -85,6 +92,26 @@ test: # runs all tests against the package with race detection and coverage perc
quick: # runs all tests without coverage or the race detector
@go test ./...

bin/nilaway:
@mkdir -p $(MAKEFILE_DIR)/bin
@GOBIN=$(GOBIN) go install go.uber.org/nilaway/cmd/nilaway@latest

.PHONY: nilaway
nilaway: bin/nilaway
@$(GOBIN)/nilaway -test=false ./...

.PHONY: nilaway
nilaway_tests: bin/nilaway
@$(GOBIN)/nilaway -test=true ./...

bin/golangci-lint:
@mkdir -p $(GOBIN)
@GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

.PHONY: golangci-lint
golangci-lint: bin/golangci-lint
@$(GOBIN)/golangci-lint run ./...

.PHONY: bench
bench:
go test -run '^$$' -bench . -benchmem ./...
Expand All @@ -95,5 +122,6 @@ bench_comp:

.PHONY: clean
clean:
@rm -rf $(MAKEFILE_DIR)/bin
@go clean

Loading