update linting

This commit is contained in:
Sergey Dudoladov
2019-10-02 13:36:54 +02:00
parent f0e29060b1
commit 7217046ef5
14 changed files with 60 additions and 42 deletions
+8 -6
View File
@@ -20,7 +20,7 @@ GITSTATUS = $(shell git status --porcelain || echo "no changes")
SOURCES = cmd/main.go
VERSION ?= $(shell git describe --tags --always --dirty)
DIRS := cmd pkg
PKG := `go list ./... | grep -v /vendor/`
PKG := `go list ./... | grep --invert-match /vendor/ | grep --invert-match /kubectl-pg`
ifeq ($(DEBUG),1)
DOCKERFILE = DebugDockerfile
@@ -46,7 +46,7 @@ default: local
clean:
rm -rf build scm-source.json
local: ${SOURCES}
local: test ${SOURCES}
hack/verify-codegen.sh
CGO_ENABLED=${CGO_ENABLED} go build -o build/${BINARY} $(LOCAL_BUILD_FLAGS) -ldflags "$(LDFLAGS)" $^
@@ -60,7 +60,7 @@ docker-context: scm-source.json linux
mkdir -p docker/build/
cp build/linux/${BINARY} scm-source.json docker/build/
docker: ${DOCKERDIR}/${DOCKERFILE} docker-context
docker: test ${DOCKERDIR}/${DOCKERFILE} docker-context
echo `(env)`
echo "Tag ${TAG}"
echo "Version ${VERSION}"
@@ -78,22 +78,24 @@ scm-source.json: .git
echo '{\n "url": "git:$(GITURL)",\n "revision": "$(GITHEAD)",\n "author": "$(USER)",\n "status": "$(GITSTATUS)"\n}' > scm-source.json
tools:
@go get -u github.com/gordonklaus/ineffassign
@go get -u honnef.co/go/tools/cmd/staticcheck
@go get -u github.com/Masterminds/glide
fmt:
@gofmt -l -w -s $(DIRS)
vet:
vet: fmt
@go vet $(PKG)
@ineffassign kubectl-pg pkg
@staticcheck $(PKG)
deps:
@glide install --strip-vendor
test:
test: vet
hack/verify-codegen.sh
@go test ./...
@go test $(PKG)
e2e: docker # build operator image to be tested
cd e2e; make tools test clean