Skip to content

Commit

Permalink
🌱 Add lint-config target to validate config and fix issues faced (kub…
Browse files Browse the repository at this point in the history
…ernetes-sigs#4458)

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 <[email protected]>
  • Loading branch information
camilamacedo86 authored Jan 1, 2025
1 parent 63d67e3 commit 06b67eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 3 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*'); \
Expand Down

0 comments on commit 06b67eb

Please sign in to comment.