Skip to content

Commit 815d102

Browse files
committed
Add errcheck to makefile
1 parent 55e50aa commit 815d102

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ $(BIN)/golint: PACKAGE=golang.org/x/lint/golint
3838
STATICCHECK = $(BIN)/staticcheck
3939
$(BIN)/staticcheck: PACKAGE=honnef.co/go/tools/cmd/staticcheck
4040

41+
ERRCHECK = $(BIN)/errcheck
42+
$(BIN)/errcheck: PACKAGE=github.com/kisielk/errcheck
43+
4144
GOCOV = $(BIN)/gocov
4245
$(BIN)/gocov: PACKAGE=github.com/axw/gocov/...
4346

@@ -57,10 +60,10 @@ test-verbose: ARGS=-v ## Run tests in verbose mode with coverage repo
5760
test-race: ARGS=-race ## Run tests with race detector
5861
$(TEST_TARGETS): NAME=$(MAKECMDGOALS:test-%=%)
5962
$(TEST_TARGETS): test
60-
check test tests: fmt lint vet staticcheck; $(info $(M) running $(NAME:%=% )tests…) @ ## Run tests
63+
check test tests: fmt lint vet staticcheck errcheck; $(info $(M) running $(NAME:%=% )tests…) @ ## Run tests
6164
$Q $(GO) test -timeout $(TIMEOUT)s $(ARGS) $(TESTPKGS)
6265

63-
test-xml: fmt lint vet staticcheck | $(GO2XUNIT) ; $(info $(M) running xUnit tests…) @ ## Run tests with xUnit output
66+
test-xml: fmt lint vet staticcheck errcheck | $(GO2XUNIT) ; $(info $(M) running xUnit tests…) @ ## Run tests with xUnit output
6467
$Q mkdir -p test
6568
$Q 2>&1 $(GO) test -timeout $(TIMEOUT)s -v $(TESTPKGS) | tee test/tests.output
6669
$(GO2XUNIT) -fail -input test/tests.output -output test/tests.xml
@@ -72,7 +75,7 @@ COVERAGE_HTML = $(COVERAGE_DIR)/index.html
7275
.PHONY: test-coverage test-coverage-tools
7376
test-coverage-tools: | $(GOCOV) $(GOCOVXML)
7477
test-coverage: COVERAGE_DIR := $(CURDIR)/test/coverage
75-
test-coverage: fmt lint vet staticcheck test-coverage-tools ; $(info $(M) running coverage tests…) @ ## Run coverage tests
78+
test-coverage: fmt lint vet staticcheck errcheck test-coverage-tools ; $(info $(M) running coverage tests…) @ ## Run coverage tests
7679
$Q mkdir -p $(COVERAGE_DIR)
7780
$Q $(GO) test \
7881
-coverpkg=$$($(GO) list -f '{{ join .Deps "\n" }}' $(TESTPKGS) | \
@@ -99,6 +102,10 @@ vet: ; $(info $(M) running go vet…) @ ## Run go vet on all source files
99102
staticcheck: | $(STATICCHECK) ; $(info $(M) running staticcheck…) @
100103
$Q $(STATICCHECK) $(PKGS)
101104

105+
.PHONY: errcheck
106+
errcheck: | $(ERRCHECK) ; $(info $(M) running errcheck…) @
107+
$Q $(ERRCHECK) $(PKGS)
108+
102109
# Misc
103110

104111
.PHONY: clean

0 commit comments

Comments
 (0)