diff --git a/.gitignore b/.gitignore index 96e371bbd..f19f8ae30 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ deploy/cephcsi/image/cephcsi *.orig *.patch *.rej + +# generated golangci-lint configuration +scripts/golangci.yml diff --git a/Makefile b/Makefile index 6a14e17b0..d16fac6a5 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,10 @@ mod-check: check-env @echo 'running: go mod verify' @go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false ) -go-lint: +scripts/golangci.yml: scripts/golangci.yml.in + sed "s/@@CEPH_VERSION@@/$(CEPH_VERSION)/g" < scripts/golangci.yml.in > scripts/golangci.yml + +go-lint: scripts/golangci.yml ./scripts/lint-go.sh lint-extras: @@ -163,6 +166,7 @@ clean: go clean -mod=vendor -r -x rm -f deploy/cephcsi/image/cephcsi rm -f _output/cephcsi + $(RM) scripts/golangci.yml $(RM) e2e.test [ ! -f .devel-container-id ] || $(CONTAINER_CMD) rmi $(CSI_IMAGE_NAME):devel $(RM) .devel-container-id diff --git a/scripts/golangci.yml b/scripts/golangci.yml.in similarity index 99% rename from scripts/golangci.yml rename to scripts/golangci.yml.in index 9b97d9a92..440ea12ae 100644 --- a/scripts/golangci.yml +++ b/scripts/golangci.yml.in @@ -5,6 +5,9 @@ # options for analysis running run: + build-tags: + - @@CEPH_VERSION@@ + # default concurrency is a available CPU number concurrency: 4