From 67a9c16223d8f9f68836499cfd16c61dff7ea8ca Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Wed, 17 Jan 2024 08:23:17 -0600 Subject: [PATCH] Disable dot-imports in revive golang ci lint linter The linter is picking up dot imports in test files which are a valid use-case. Until it is corrected, the dot-import rule has been disabled. Signed-off-by: Chris Doherty --- .golangci.yml | 1 + Makefile | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7b71682a..6c81ba3d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -83,6 +83,7 @@ linters-settings: - name: range-val-in-closure - name: range-val-address - name: dot-imports + disabled: true # Disable until dot-import is allowed in test files. - name: error-naming - name: error-return - name: error-strings diff --git a/Makefile b/Makefile index d37ef957..6c89a8c7 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ help: # -- Tooling -GOLANGCI_LINT_VERSION ?= v1.51.2 +GOLANGCI_LINT_VERSION ?= v1.55.2 GOLANGCI_LINT := $(TOOLS_DIR)/golangci-lint $(GOLANGCI_LINT): curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \ @@ -74,7 +74,7 @@ tools: $(GOLANGCI_LINT) $(MOCKGEN) $(SETUP_ENVTEST) $(HADOLINT) $(YAMLLINT_BIN) .PHONY: clean-tools clean-tools: ## Remove tools installed for development. - chmod -R +w $(TOOLS_DIR)/envtest + @chmod -R +w $(TOOLS_DIR)/envtest &> /dev/null || true rm -rf $(TOOLS_DIR) # -- Everything else @@ -115,7 +115,7 @@ setup-envtest: $(SETUP_ENVTEST) # Integration tests are located next to unit test. This recipe will search the code base for # files including the "//go:build integration" build tag and build them into the test binary. -# For packages containing both unit and integration tests its recommended to populate +# For packages containing both unit and integration tests its recommended to populate # "//go:build !integration" in all unit test sources so as to avoid compiling them in this recipe. .PHONY: test-integration test-integration: ## Run integration tests. @@ -134,7 +134,7 @@ image: build DOCKER_BUILDKIT=1 docker build $(IMAGE_ARGS) . mocks: ## Generate mocks for testing. -mocks: $(MOCKGEN) +mocks: $(MOCKGEN) $(MOCKGEN) \ -destination internal/frontend/ec2/frontend_mock_test.go \ -package ec2 \