Skip to content

Commit 06b67eb

Browse files
🌱 Add lint-config target to validate config and fix issues faced (#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]>
1 parent 63d67e3 commit 06b67eb

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
uses: actions/setup-go@v5
2222
with:
2323
go-version-file: go.mod
24+
- name: Check linter configuration
25+
run: make lint-config
2426
- name: Run linter
2527
uses: golangci/golangci-lint-action@v6
2628
with:

.golangci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ issues:
1717
- gosec
1818

1919
linters-settings:
20-
govet:
21-
enable=fieldalignment: true
2220
revive:
2321
rules:
2422
# The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
@@ -28,9 +26,9 @@ linters-settings:
2826
- name: dot-imports
2927
arguments:
3028
# dot import should be ONLY allowed for ginkgo testing packages
31-
allowedPackages:
32-
- "github.com/onsi/ginkgo/v2"
33-
- "github.com/onsi/gomega"
29+
- allowedPackages:
30+
- "github.com/onsi/ginkgo/v2"
31+
- "github.com/onsi/gomega"
3432
- name: error-return
3533
- name: error-strings
3634
- name: error-naming

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ lint: golangci-lint yamllint ## Run golangci-lint linter & yamllint
105105
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
106106
$(GOLANGCI_LINT) run --fix
107107

108+
.PHONY: lint-config
109+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
110+
$(GOLANGCI_LINT) config verify
111+
108112
.PHONY: yamllint
109113
yamllint:
110114
@files=$$(find testdata -name '*.yaml' ! -path 'testdata/*/dist/*'); \

0 commit comments

Comments
 (0)