Skip to content

Commit 9a4731c

Browse files
committed
chore: migrate to v2 golangci-lint
Signed-off-by: Bence Csati <[email protected]>
1 parent 601cb45 commit 9a4731c

File tree

2 files changed

+24
-54
lines changed

2 files changed

+24
-54
lines changed

.golangci.yml

+23-53
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,37 @@
1+
version: "2"
12
run:
2-
timeout: 5m
3+
timeout: 10m
34
allow-parallel-runners: true
45

5-
linters-settings:
6-
gci:
7-
sections:
8-
- standard
9-
- default
10-
- prefix(github.com/kube-logging/telemetry-controller)
11-
goimports:
12-
local-prefixes: github.com/kube-logging/telemetry-controller
13-
misspell:
14-
locale: US
15-
nolintlint:
16-
allow-unused: false # report any unused nolint directives
17-
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
18-
19-
issues:
20-
# don't skip warning about doc comments
21-
# don't exclude the default set of lint
22-
exclude-use-default: false
23-
# restore some of the defaults
24-
# (fill in the rest as needed)
25-
exclude-rules:
26-
- path: "api/*"
27-
linters:
28-
- lll
29-
- path: "pkg/resources/*"
30-
linters:
31-
- dupl
32-
- lll
33-
- path: "controllers/*"
34-
linters:
35-
- dupl
36-
- lll
37-
- gci
38-
- path: "cmd/main.go"
39-
linters:
40-
- gci
6+
formatters:
7+
settings:
8+
gci:
9+
sections:
10+
- standard
11+
- default
12+
- prefix(github.com/kube-logging/telemetry-controller)
13+
goimports:
14+
local-prefixes:
15+
- github.com/kube-logging/telemetry-controller
16+
gofmt:
17+
simplify: true
18+
gofumpt:
19+
extra-rules: false
4120

4221
linters:
43-
disable-all: true
22+
settings:
23+
misspell:
24+
locale: US
25+
gocyclo:
26+
min-complexity: 15
4427
enable:
28+
- staticcheck
4529
- bodyclose
46-
- copyloopvar
47-
- dupl
4830
- errcheck
49-
- gci
50-
- goconst
51-
- gocyclo
52-
- gofmt
53-
- gofumpt
54-
- goimports
55-
- gosimple
56-
- govet
5731
- ineffassign
58-
- lll
5932
- misspell
6033
- nolintlint
61-
- prealloc
62-
- staticcheck
63-
- typecheck
6434
- unconvert
65-
- unparam
35+
- unparam
6636
- unused
6737
- whitespace

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CONTROLLER_TOOLS_VERSION := 0.17.2
99
KUSTOMIZE_VERSION := 5.5.0
1010

1111
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver
12-
GOLANGCI_LINT_VERSION := 1.64.8
12+
GOLANGCI_LINT_VERSION := 2.0.2
1313

1414
# renovate: datasource=github-releases depName=kubernetes-sigs/kind versioning=semver
1515
KIND_VERSION ?= 0.26.0

0 commit comments

Comments
 (0)