Skip to content

Commit 1808c51

Browse files
Bump golangci/golangci-lint-action from 6 to 7 (#431)
* Bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update golangci-lint configuration and fix linting issues --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andreas Fritzler <andreas.fritzler@sap.com>
1 parent 6b479b0 commit 1808c51

5 files changed

Lines changed: 54 additions & 49 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
with:
1616
go-version-file: 'go.mod'
1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v6
18+
uses: golangci/golangci-lint-action@v7
1919
with:
20-
version: v1.64
20+
version: v2.0

.golangci.yml

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,66 @@
1+
version: "2"
12
run:
2-
timeout: 10m
33
allow-parallel-runners: true
4-
5-
issues:
6-
# don't skip warning about doc comments
7-
# don't exclude the default set of lint
8-
exclude-use-default: false
9-
# restore some of the defaults
10-
# (fill in the rest as needed)
11-
exclude-rules:
12-
- path: "clientutils/*"
13-
linters:
14-
- lll
15-
- path: "envtestutils/*"
16-
linters:
17-
- lll
18-
- path: "unstructuredutils/*"
19-
linters:
20-
- lll
21-
- path: "metautils/*"
22-
linters:
23-
- lll
24-
- path: "kustomizeutils/*"
25-
linters:
26-
- lll
27-
- path: "configutils/*"
28-
linters:
29-
- lll
30-
- path: "conditionutils/*"
31-
linters:
32-
- lll
33-
- path: "testutils/*"
34-
linters:
35-
- lll
36-
- path: "cmdutils/*"
37-
linters:
38-
- dupl
394
linters:
40-
disable-all: true
5+
default: none
416
enable:
427
- copyloopvar
438
- dupl
449
- errcheck
10+
- ginkgolinter
4511
- goconst
4612
- gocyclo
47-
- gofmt
48-
- goimports
49-
- gosimple
5013
- govet
5114
- ineffassign
52-
- ginkgolinter
5315
- lll
5416
- misspell
5517
- nakedret
5618
- prealloc
5719
- staticcheck
58-
- typecheck
5920
- unconvert
6021
- unparam
61-
- unused
22+
- unused
23+
exclusions:
24+
generated: lax
25+
rules:
26+
- linters:
27+
- lll
28+
path: clientutils/*
29+
- linters:
30+
- lll
31+
path: envtestutils/*
32+
- linters:
33+
- lll
34+
path: unstructuredutils/*
35+
- linters:
36+
- lll
37+
path: metautils/*
38+
- linters:
39+
- lll
40+
path: kustomizeutils/*
41+
- linters:
42+
- lll
43+
path: configutils/*
44+
- linters:
45+
- lll
46+
path: conditionutils/*
47+
- linters:
48+
- lll
49+
path: testutils/*
50+
- linters:
51+
- dupl
52+
path: cmdutils/*
53+
paths:
54+
- third_party$
55+
- builtin$
56+
- examples$
57+
formatters:
58+
enable:
59+
- gofmt
60+
- goimports
61+
exclusions:
62+
generated: lax
63+
paths:
64+
- third_party$
65+
- builtin$
66+
- examples$

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GOLANGCILINT ?= $(LOCALBIN)/golangci-lint
7575
ADDLICENSE_VERSION ?= v1.1.1
7676
GOIMPORTS_VERSION ?= v0.31.0
7777
MOCKGEN_VERSION ?= v0.5.0
78-
GOLANGCILINT_VERSION ?= v1.64
78+
GOLANGCILINT_VERSION ?= v2.0
7979

8080
.PHONY: addlicense
8181
addlicense: $(ADDLICENSE) ## Download addlicense locally if necessary.
@@ -95,4 +95,4 @@ $(MOCKGEN): $(LOCALBIN)
9595
.PHONY: goimports
9696
golangci-lint: $(GOLANGCILINT) ## Download golangci-lint locally if necessary.
9797
$(GOLANGCILINT): $(LOCALBIN)
98-
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCILINT_VERSION)
98+
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCILINT_VERSION)

clientutils/clientutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ func setObject(dst, src client.Object) error {
467467
// IsOlderThan returns a function that determines whether an object is older than another.
468468
func IsOlderThan(obj client.Object) func(other client.Object) (bool, error) {
469469
return func(other client.Object) (bool, error) {
470-
return obj.GetCreationTimestamp().Time.After(other.GetCreationTimestamp().Time), nil
470+
return obj.GetCreationTimestamp().After(other.GetCreationTimestamp().Time), nil
471471
}
472472
}
473473

metautils/metautils_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type BadList struct {
3131

3232
func (b *BadList) DeepCopyObject() runtime.Object {
3333
return &BadList{
34-
*b.ListMeta.DeepCopy(),
34+
*b.DeepCopy(),
3535
b.TypeMeta,
3636
}
3737
}

0 commit comments

Comments
 (0)