mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
Install separate golangci-lint for static-check (#21842)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
a885eb451a
commit
09124f87ae
21
Makefile
21
Makefile
@ -21,6 +21,10 @@ OS := $(shell uname -s)
|
|||||||
ARCH := $(shell arch)
|
ARCH := $(shell arch)
|
||||||
mode = Release
|
mode = Release
|
||||||
disk_index = OFF
|
disk_index = OFF
|
||||||
|
useasan = false
|
||||||
|
ifeq (${USE_ASAN}, true)
|
||||||
|
useasan = true
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
export GIT_BRANCH=master
|
export GIT_BRANCH=master
|
||||||
@ -37,9 +41,9 @@ get-build-deps:
|
|||||||
|
|
||||||
# attention: upgrade golangci-lint should also change Dockerfiles in build/docker/builder/cpu/<os>
|
# attention: upgrade golangci-lint should also change Dockerfiles in build/docker/builder/cpu/<os>
|
||||||
getdeps:
|
getdeps:
|
||||||
@mkdir -p ${GOPATH}/bin
|
@mkdir -p $(INSTALL_PATH)
|
||||||
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.46.2)
|
@$(INSTALL_PATH)/golangci-lint --version 2>&1 1>/dev/null || (echo "Installing golangci-lint into ./bin/" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(INSTALL_PATH) v1.46.2)
|
||||||
@$(PWD)/bin/mockery --version 2>&1 1>/dev/null || (echo "Installing mockery v2.16.0 to ./bin/" && GOBIN=$(PWD)/bin/ go install github.com/vektra/mockery/v2@v2.16.0)
|
@$(INSTALL_PATH)/mockery --version 2>&1 1>/dev/null || (echo "Installing mockery v2.16.0 to ./bin/" && GOBIN=$(INSTALL_PATH)/ go install github.com/vektra/mockery/v2@v2.16.0)
|
||||||
|
|
||||||
tools/bin/revive: tools/check/go.mod
|
tools/bin/revive: tools/check/go.mod
|
||||||
cd tools/check; \
|
cd tools/check; \
|
||||||
@ -78,12 +82,11 @@ lint: tools/bin/revive
|
|||||||
@tools/bin/revive -formatter friendly -config tools/check/revive.toml ./...
|
@tools/bin/revive -formatter friendly -config tools/check/revive.toml ./...
|
||||||
|
|
||||||
#TODO: Check code specifications by golangci-lint
|
#TODO: Check code specifications by golangci-lint
|
||||||
static-check:
|
static-check: getdeps
|
||||||
@echo "Running $@ check"
|
@echo "Running $@ check"
|
||||||
@GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean
|
@GO111MODULE=on $(INSTALL_PATH)/golangci-lint cache clean
|
||||||
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=30m --config ./.golangci.yml ./internal/...
|
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./internal/...
|
||||||
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=30m --config ./.golangci.yml ./cmd/...
|
@source $(PWD)/scripts/setenv.sh && GO111MODULE=on $(INSTALL_PATH)/golangci-lint run --timeout=30m --config ./.golangci.yml ./cmd/...
|
||||||
# @GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=30m --config ./.golangci.yml ./tests/go_client/...
|
|
||||||
|
|
||||||
verifiers: build-cpp getdeps cppcheck fmt static-check
|
verifiers: build-cpp getdeps cppcheck fmt static-check
|
||||||
|
|
||||||
@ -150,7 +153,7 @@ build-cpp-with-unittest: download-milvus-proto
|
|||||||
|
|
||||||
build-cpp-with-coverage: download-milvus-proto
|
build-cpp-with-coverage: download-milvus-proto
|
||||||
@echo "Building Milvus cpp library with coverage and unittest ..."
|
@echo "Building Milvus cpp library with coverage and unittest ..."
|
||||||
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -a ${USE_ASAN} -c -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
@(env bash $(PWD)/scripts/core_build.sh -t ${mode} -u -a ${useasan} -c -f "$(CUSTOM_THIRDPARTY_PATH)" -n ${disk_index})
|
||||||
|
|
||||||
|
|
||||||
# Run the tests.
|
# Run the tests.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user