Skip to content

Commit 418be38

Browse files
committed
chore: migrate to v2 golangci-lint
Signed-off-by: Bence Csati <[email protected]>
1 parent 1a256b6 commit 418be38

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

.golangci.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,39 @@
1-
linters-settings:
2-
revive:
3-
min-confidence: 0.9
4-
gocyclo:
5-
min-complexity: 15
1+
version: "2"
2+
run:
3+
timeout: 10m
4+
allow-parallel-runners: true
65

6+
formatters:
7+
settings:
8+
gci:
9+
sections:
10+
- standard
11+
- default
12+
- prefix(github.com/kube-logging/logging-operator)
13+
goimports:
14+
local-prefixes:
15+
- github.com/kube-logging/logging-operator
16+
gofmt:
17+
simplify: true
18+
gofumpt:
19+
extra-rules: false
720

8-
issues:
9-
exclude-dirs:
10-
- .gen
11-
- client
12-
exclude:
13-
- if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
14-
- "`if` block ends with a `return` statement, so drop this `else` and outdent its block"
15-
- "missing the call to method parallel"
21+
linters:
22+
settings:
23+
misspell:
24+
locale: US
25+
revive:
26+
confidence: 0.9
27+
gocyclo:
28+
min-complexity: 15
29+
enable:
30+
- bodyclose
31+
- errcheck
32+
- ineffassign
33+
- misspell
34+
- nolintlint
35+
- revive
36+
- unconvert
37+
- unparam
38+
- unused
39+
- whitespace

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
CONTROLLER_GEN_VERSION := 0.17.2
99

1010
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver
11-
GOLANGCI_LINT_VERSION := 1.64.8
11+
GOLANGCI_LINT_VERSION := 2.0.2
1212

1313
# renovate: datasource=go depName=github.com/vladopajic/go-test-coverage/v2 versioning=semver
1414
GO_TEST_COVERAGE_VERSION := 2.13.0
@@ -284,7 +284,7 @@ ${ENVTEST_BINARY_ASSETS}_${ENVTEST_K8S_VERSION}: | ${SETUP_ENVTEST} ${ENVTEST_BI
284284
${GOLANGCI_LINT}: ${GOLANGCI_LINT}_${GOLANGCI_LINT_VERSION}_${GOVERSION} | ${BIN}
285285
ln -sf $(notdir $<) $@
286286

287-
${GOLANGCI_LINT}_${GOLANGCI_LINT_VERSION}_${GOVERSION}: IMPORT_PATH := github.com/golangci/golangci-lint/cmd/golangci-lint
287+
${GOLANGCI_LINT}_${GOLANGCI_LINT_VERSION}_${GOVERSION}: IMPORT_PATH := github.com/golangci/golangci-lint/v2/cmd/golangci-lint
288288
${GOLANGCI_LINT}_${GOLANGCI_LINT_VERSION}_${GOVERSION}: VERSION := v${GOLANGCI_LINT_VERSION}
289289
${GOLANGCI_LINT}_${GOLANGCI_LINT_VERSION}_${GOVERSION}: | ${BIN}
290290
${go_install_binary}

0 commit comments

Comments
 (0)