Skip to content

Commit aebcef8

Browse files
(go/v4): Add new makefile target to check and validate the linter config
Co-Author: Mateus Oliveira <msouzaol@redhat.com>
1 parent 4f1a0bf commit aebcef8

File tree

8 files changed

+31
-0
lines changed

8 files changed

+31
-0
lines changed

.github/workflows/lint-sample.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
- name: Prepare ${{ matrix.folder }}
3030
working-directory: ${{ matrix.folder }}
3131
run: go mod tidy
32+
- name: Check linter configuration
33+
working-directory: ${{ matrix.folder }}
34+
run: make lint-config
3235
- name: Run linter
3336
uses: golangci/golangci-lint-action@v6
3437
with:

docs/book/src/cronjob-tutorial/testdata/project/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ lint: golangci-lint ## Run golangci-lint linter
9090
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
9191
$(GOLANGCI_LINT) run --fix
9292

93+
.PHONY: lint-config
94+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
95+
$(GOLANGCI_LINT) config verify
96+
9397
##@ Build
9498

9599
.PHONY: build

docs/book/src/getting-started/testdata/project/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ lint: golangci-lint ## Run golangci-lint linter
8686
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
8787
$(GOLANGCI_LINT) run --fix
8888

89+
.PHONY: lint-config
90+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
91+
$(GOLANGCI_LINT) config verify
92+
8993
##@ Build
9094

9195
.PHONY: build

docs/book/src/multiversion-tutorial/testdata/project/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ lint: golangci-lint ## Run golangci-lint linter
9090
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
9191
$(GOLANGCI_LINT) run --fix
9292

93+
.PHONY: lint-config
94+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
95+
$(GOLANGCI_LINT) config verify
96+
9397
##@ Build
9498

9599
.PHONY: build

pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ lint: golangci-lint ## Run golangci-lint linter
165165
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
166166
$(GOLANGCI_LINT) run --fix
167167
168+
.PHONY: lint-config
169+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
170+
$(GOLANGCI_LINT) config verify
171+
168172
##@ Build
169173
170174
.PHONY: build

testdata/project-v4-multigroup/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ lint: golangci-lint ## Run golangci-lint linter
8686
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
8787
$(GOLANGCI_LINT) run --fix
8888

89+
.PHONY: lint-config
90+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
91+
$(GOLANGCI_LINT) config verify
92+
8993
##@ Build
9094

9195
.PHONY: build

testdata/project-v4-with-plugins/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ lint: golangci-lint ## Run golangci-lint linter
8686
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
8787
$(GOLANGCI_LINT) run --fix
8888

89+
.PHONY: lint-config
90+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
91+
$(GOLANGCI_LINT) config verify
92+
8993
##@ Build
9094

9195
.PHONY: build

testdata/project-v4/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ lint: golangci-lint ## Run golangci-lint linter
8686
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
8787
$(GOLANGCI_LINT) run --fix
8888

89+
.PHONY: lint-config
90+
lint-config: golangci-lint ## Verify golangci-lint linter configuration
91+
$(GOLANGCI_LINT) config verify
92+
8993
##@ Build
9094

9195
.PHONY: build

0 commit comments

Comments
 (0)