Skip to content

Commit

Permalink
fix: use same golangci-lint version
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <[email protected]>
  • Loading branch information
mateusoliveira43 committed Dec 17, 2024
1 parent 43ee3f6 commit 33024c9
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0
7 changes: 6 additions & 1 deletion pkg/plugins/golang/v4/scaffolds/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ import (
)

const (
// GolangciLintVersion is the golangci-lint version to be used in the project
GolangciLintVersion = "v1.61.0"
// ControllerRuntimeVersion is the kubernetes-sigs/controller-runtime version to be used in the project
ControllerRuntimeVersion = "v0.19.1"
// ControllerToolsVersion is the kubernetes-sigs/controller-tools version to be used in the project
Expand Down Expand Up @@ -154,6 +156,7 @@ func (s *initScaffolder) Scaffold() error {
BoilerplatePath: s.boilerplatePath,
ControllerToolsVersion: ControllerToolsVersion,
KustomizeVersion: kustomizeVersion,
GolangciLintVersion: GolangciLintVersion,
ControllerRuntimeVersion: ControllerRuntimeVersion,
EnvtestVersion: getControllerRuntimeReleaseBranch(),
},
Expand All @@ -166,7 +169,9 @@ func (s *initScaffolder) Scaffold() error {
&e2e.SuiteTest{},
&github.E2eTestCi{},
&github.TestCi{},
&github.LintCi{},
&github.LintCi{
GolangciLintVersion: GolangciLintVersion,
},
&utils.Utils{},
&templates.DevContainer{},
&templates.DevContainerPostInstallScript{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ var _ machinery.Template = &TestCi{}
type LintCi struct {
machinery.TemplateMixin
machinery.BoilerplateMixin

// golangci-lint version to use in the project
GolangciLintVersion string
}

// SetTemplateDefaults implements machinery.Template
Expand Down Expand Up @@ -65,5 +68,5 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: {{ .GolangciLintVersion }}
`
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type Makefile struct {
ControllerToolsVersion string
// Kustomize version to use in the project
KustomizeVersion string
// golangci-lint version to use in the project
GolangciLintVersion string
// ControllerRuntimeVersion version to be used to download the envtest setup script
ControllerRuntimeVersion string
// EnvtestVersion store the name of the verions to be used to install setup-envtest
Expand Down Expand Up @@ -251,7 +253,7 @@ CONTROLLER_TOOLS_VERSION ?= {{ .ControllerToolsVersion }}
ENVTEST_VERSION ?= $(shell go list -m -f "{{ "{{ .Version }}" }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ "{{ .Version }}" }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
GOLANGCI_LINT_VERSION ?= v1.61.0
GOLANGCI_LINT_VERSION ?= {{ .GolangciLintVersion }}
.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0
2 changes: 1 addition & 1 deletion testdata/project-v4/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
version: v1.61.0

0 comments on commit 33024c9

Please sign in to comment.