From 06b67ebac19f397ac7a32aad78e73902dec0668f Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Wed, 1 Jan 2025 09:25:48 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20Add=20lint-config=20target=20to?= =?UTF-8?q?=20validate=20config=20and=20fix=20issues=20faced=20(#4458)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add lint-config target to validate config and fix issues faced Fix golangci-lint config schema errors: corrected invalid govet fieldalignment Co-Author: Mateus Oliveira --- .github/workflows/lint.yml | 2 ++ .golangci.yml | 8 +++----- Makefile | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8f84da91633..b041718c9fe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,6 +21,8 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: go.mod + - name: Check linter configuration + run: make lint-config - name: Run linter uses: golangci/golangci-lint-action@v6 with: diff --git a/.golangci.yml b/.golangci.yml index f768e89d686..46d1da82722 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,8 +17,6 @@ issues: - gosec linters-settings: - govet: - enable=fieldalignment: true revive: rules: # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration @@ -28,9 +26,9 @@ linters-settings: - name: dot-imports arguments: # dot import should be ONLY allowed for ginkgo testing packages - allowedPackages: - - "github.com/onsi/ginkgo/v2" - - "github.com/onsi/gomega" + - allowedPackages: + - "github.com/onsi/ginkgo/v2" + - "github.com/onsi/gomega" - name: error-return - name: error-strings - name: error-naming diff --git a/Makefile b/Makefile index acdc7fce14d..0604fc547ff 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,10 @@ lint: golangci-lint yamllint ## Run golangci-lint linter & yamllint lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes $(GOLANGCI_LINT) run --fix +.PHONY: lint-config +lint-config: golangci-lint ## Verify golangci-lint linter configuration + $(GOLANGCI_LINT) config verify + .PHONY: yamllint yamllint: @files=$$(find testdata -name '*.yaml' ! -path 'testdata/*/dist/*'); \