staticcheck

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2017-12-11 13:33:44 -05:00
parent 0ff43808ca
commit a1d0f6f9c0
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
2 changed files with 9 additions and 2 deletions

View file

@ -15,9 +15,11 @@
- GO15VENDOREXPERIMENT=1
install:
- go get github.com/golang/lint/golint
- go get honnef.co/go/tools/cmd/staticcheck
script:
- go build -v
- go vet $(go list ./... | grep -v vendor)
- staticcheck $(go list ./... | grep -v vendor)
- test -z "$(golint ./... | grep -v vendor | tee /dev/stderr)"
- test -z "$(gofmt -s -l . | grep -v vendor | tee /dev/stderr)"
- make dind dtest

View file

@ -26,7 +26,7 @@ GO_LDFLAGS_STATIC=-ldflags "-w $(CTIMEVAR) -extldflags -static"
# List the GOOS and GOARCH to build
GOOSARCHES = darwin/amd64 darwin/386 freebsd/amd64 freebsd/386 linux/arm linux/arm64 linux/amd64 linux/386 solaris/amd64 windows/amd64 windows/386
all: clean build fmt lint test vet install ## Runs a clean, build, fmt, lint, test, vet and install
all: clean build fmt lint test staticcheck vet install ## Runs a clean, build, fmt, lint, test, vet and install
.PHONY: build
build: $(NAME) ## Builds a dynamic executable or package
@ -62,6 +62,11 @@ vet: ## Verifies `go vet` passes
@echo "+ $@"
@go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
.PHONY: staticcheck
staticcheck: ## Verifies `staticcheck` passes
@echo "+ $@"
@staticcheck $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
.PHONY: install
install: ## Installs the executable or package
@echo "+ $@"
@ -98,7 +103,7 @@ release: *.go VERSION ## Builds the cross-compiled binaries, naming them in such
.PHONY: bump-version
BUMP := patch
bump-version: ## Bump the version in the version file. Set KIND to [ patch | major | minor ]
bump-version: ## Bump the version in the version file. Set BUMP to [ patch | major | minor ]
@go get -u github.com/jessfraz/junk/sembump # update sembump tool
$(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
@echo "Bumping VERSION from $(VERSION) to $(NEW_VERSION)"