From b779390f28712e656d5e26d349b71d7739e75f0d Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 31 Dec 2019 17:32:27 -0500 Subject: [PATCH 1/2] Simplify lint targets Signed-off-by: Yuri Shkuro --- Makefile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 66da34e4b07..f6de9fc0545 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,6 @@ GOTEST=go test -v $(RACE) GOLINT=golint GOVET=go vet GOFMT=gofmt -GOSEC=gosec -quiet -exclude=G104,G107 -STATICCHECK=staticcheck FMT_LOG=fmt.log LINT_LOG=lint.log IMPORT_LOG=import.log @@ -36,7 +34,7 @@ IMPORT_LOG=import.log GIT_SHA=$(shell git rev-parse HEAD) GIT_CLOSEST_TAG=$(shell git describe --abbrev=0 --tags) DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') -BUILD_INFO_IMPORT_PATH=github.com/jaegertracing/jaeger/pkg/version +BUILD_INFO_IMPORT_PATH=$(PROJECT_ROOT)/pkg/version BUILD_INFO=-ldflags "-X $(BUILD_INFO_IMPORT_PATH).commitSHA=$(GIT_SHA) -X $(BUILD_INFO_IMPORT_PATH).latestVersion=$(GIT_CLOSEST_TAG) -X $(BUILD_INFO_IMPORT_PATH).date=$(DATE)" SED=sed @@ -141,13 +139,12 @@ fmt: .PHONY: lint-gosec lint-gosec: - time $(GOSEC) ./... + GO111MODULE=off time gosec -quiet -exclude=G104,G107 $(PROJECT_ROOT)/... .PHONY: lint-staticcheck lint-staticcheck: - @echo Running staticcheck... @cat /dev/null > $(LINT_LOG) - @time $(STATICCHECK) ./... \ + time staticcheck ./... \ | grep -v \ -e model/model.pb.go \ -e thrift-gen/ \ @@ -160,8 +157,8 @@ lint: lint-staticcheck lint-gosec $(MAKE) go-lint @echo Running go fmt on ALL_SRC ... @$(GOFMT) -e -s -l $(ALL_SRC) > $(FMT_LOG) - @./scripts/updateLicenses.sh >> $(FMT_LOG) - @./scripts/import-order-cleanup.sh stdout > $(IMPORT_LOG) + ./scripts/updateLicenses.sh >> $(FMT_LOG) + ./scripts/import-order-cleanup.sh stdout > $(IMPORT_LOG) @[ ! -s "$(FMT_LOG)" -a ! -s "$(IMPORT_LOG)" ] || (echo "Go fmt, license check, or import ordering failures, run 'make fmt'" | cat - $(FMT_LOG) && false) .PHONY: go-lint From abca6ab7f410a80b2c34b96ff993fa4d30a79913 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Tue, 31 Dec 2019 17:36:15 -0500 Subject: [PATCH 2/2] Use dot files for linting logs Signed-off-by: Yuri Shkuro --- .gitignore | 6 +++--- Makefile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index bb59b436031..99f7c3440e8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,9 @@ *.test *.xml *.swp -fmt.log -import.log -lint.log +.fmt.log +.import.log +.lint.log cover.html .envrc .idea/ diff --git a/Makefile b/Makefile index f6de9fc0545..0283dcbff5c 100644 --- a/Makefile +++ b/Makefile @@ -27,9 +27,9 @@ GOTEST=go test -v $(RACE) GOLINT=golint GOVET=go vet GOFMT=gofmt -FMT_LOG=fmt.log -LINT_LOG=lint.log -IMPORT_LOG=import.log +FMT_LOG=.fmt.log +LINT_LOG=.lint.log +IMPORT_LOG=.import.log GIT_SHA=$(shell git rev-parse HEAD) GIT_CLOSEST_TAG=$(shell git describe --abbrev=0 --tags)