mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-15 06:06:03 -06:00
Fixed .check-fmt, .check-lint, ifne not working on OSX
Fixed .check-static for skip errors
This commit is contained in:
parent
9aefa6ca88
commit
5491fa1a22
1 changed files with 17 additions and 6 deletions
23
Makefile
23
Makefile
|
|
@ -1,3 +1,10 @@
|
|||
|
||||
GO_FILES := $(shell \
|
||||
find . '(' -path '*/.*' -o -path './vendor' ')' -prune \
|
||||
-o -name '*.go' -print | cut -b3-)
|
||||
|
||||
LINT_IGNORE := "/id/\|/tunnelmock/\|/vendor/"
|
||||
|
||||
all: clean check test
|
||||
|
||||
.PHONY: clean
|
||||
|
|
@ -13,7 +20,10 @@ check: .check-fmt .check-vet .check-lint .check-ineffassign .check-static .check
|
|||
|
||||
.PHONY: .check-fmt
|
||||
.check-fmt:
|
||||
@go fmt ./... | tee /dev/stderr | ifne false
|
||||
$(eval FMT_LOG := $(shell mktemp -t gofmt.XXXXX))
|
||||
@cat /dev/null > $(FMT_LOG)
|
||||
@gofmt -e -s -l -d $(GO_FILES) > $(FMT_LOG) || true
|
||||
@[ ! -s "$(FMT_LOG)" ] || (echo "$@ failed:" | cat - $(FMT_LOG) && false)
|
||||
|
||||
.PHONY: .check-vet
|
||||
.check-vet:
|
||||
|
|
@ -21,10 +31,11 @@ check: .check-fmt .check-vet .check-lint .check-ineffassign .check-static .check
|
|||
|
||||
.PHONY: .check-lint
|
||||
.check-lint:
|
||||
@golint `go list ./...` \
|
||||
| grep -v /id/ \
|
||||
| grep -v /tunnelmock/ \
|
||||
| tee /dev/stderr | ifne false
|
||||
$(eval LINT_LOG := $(shell mktemp -t golint.XXXXX))
|
||||
@cat /dev/null > $(LINT_LOG)
|
||||
@$(foreach pkg, $(GO_FILES), golint $(pkg | grep -v $LINT_IGNORE) >> $(LINT_LOG) || true;)
|
||||
@[ ! -s "$(LINT_LOG)" ] || (echo "$@ failed:" | cat - $(LINT_LOG) && false)
|
||||
|
||||
|
||||
.PHONY: .check-ineffassign
|
||||
.check-ineffassign:
|
||||
|
|
@ -36,7 +47,7 @@ check: .check-fmt .check-vet .check-lint .check-ineffassign .check-static .check
|
|||
|
||||
.PHONY: .check-mega
|
||||
.check-static:
|
||||
@staticcheck ./...
|
||||
@staticcheck -checks ['SA1006','ST1005'] ./...
|
||||
|
||||
.PHONY: .check-vendor
|
||||
.check-vendor:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue