Remove fmt and vet checks from CI (#13063)
* Remove fmt and vet checks from CI - golangci-lint already does the vet and fmt checks. Remove those as it is redundant now. - Also start running golangci-lint as part of the CI pipeline now just as an extra layer of reliability. * Incorporate review comments * Adding golangci install to Jenkinsfile.pr too * dummy commit to test jenkins * Trying after cd to directory * Fix ineffective assign
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
8c22455d41
Коммит
3f072159e3
28
Makefile
28
Makefile
@@ -149,31 +149,10 @@ else
|
||||
endif
|
||||
|
||||
|
||||
govet: ## Runs govet against all packages.
|
||||
@echo Running GOVET
|
||||
env GO111MODULE=off $(GO) get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
|
||||
$(GO) vet $(GOFLAGS) $(ALL_PACKAGES) || exit 1
|
||||
$(GO) vet -vettool=$(GOPATH)/bin/shadow $(GOFLAGS) $(ALL_PACKAGES) || exit 1
|
||||
plugin-checker:
|
||||
$(GO) run $(GOFLAGS) ./plugin/checker
|
||||
|
||||
gofmt: ## Runs gofmt against all packages.
|
||||
@echo Running GOFMT
|
||||
|
||||
@for package in $(TE_PACKAGES) $(EE_PACKAGES); do \
|
||||
echo "Checking "$$package; \
|
||||
files=$$($(GO) list $(GOFLAGS) -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' $$package); \
|
||||
if [ "$$files" ]; then \
|
||||
gofmt_output=$$(gofmt -d -s $$files 2>&1); \
|
||||
if [ "$$gofmt_output" ]; then \
|
||||
echo "$$gofmt_output"; \
|
||||
echo "gofmt failure"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
@echo "gofmt success"; \
|
||||
|
||||
golangci-lint: ## Run golangci-lint on codebasis
|
||||
golangci-lint: ## Run golangci-lint on codebase
|
||||
# https://stackoverflow.com/a/677212/1027058 (check if a command exists or not)
|
||||
@if ! [ -x "$$(command -v golangci-lint)" ]; then \
|
||||
echo "golangci-lint is not installed. Please see https://github.com/golangci/golangci-lint#install for installation instructions."; \
|
||||
@@ -229,8 +208,7 @@ check-licenses: ## Checks license status.
|
||||
check-prereqs: ## Checks prerequisite software status.
|
||||
./scripts/prereq-check.sh
|
||||
|
||||
# TODO: remove govet and gofmt checks once golangci-lint is being enforced.
|
||||
check-style: govet gofmt check-licenses check-plugin-golint ## Runs govet and gofmt against all packages and also ensures plugin package golint compliant
|
||||
check-style: golangci-lint plugin-checker check-licenses check-plugin-golint ## Runs golangci against all packages and also ensures plugin package golint compliant
|
||||
|
||||
check-plugin-golint: # Checks if golint returns any uncompliant code for any file that starts with plugin/helpers
|
||||
@! golint ./plugin/ | grep plugin/helpers
|
||||
|
||||
Ссылка в новой задаче
Block a user