Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v7
with:
version: v1.64
version: v2.0
91 changes: 48 additions & 43 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,66 @@
version: "2"
run:
timeout: 10m
allow-parallel-runners: true

issues:
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: "clientutils/*"
linters:
- lll
- path: "envtestutils/*"
linters:
- lll
- path: "unstructuredutils/*"
linters:
- lll
- path: "metautils/*"
linters:
- lll
- path: "kustomizeutils/*"
linters:
- lll
- path: "configutils/*"
linters:
- lll
- path: "conditionutils/*"
linters:
- lll
- path: "testutils/*"
linters:
- lll
- path: "cmdutils/*"
linters:
- dupl
linters:
disable-all: true
default: none
enable:
- copyloopvar
- dupl
- errcheck
- ginkgolinter
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- ginkgolinter
- lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- unused
exclusions:
generated: lax
rules:
- linters:
- lll
path: clientutils/*
- linters:
- lll
path: envtestutils/*
- linters:
- lll
path: unstructuredutils/*
- linters:
- lll
path: metautils/*
- linters:
- lll
path: kustomizeutils/*
- linters:
- lll
path: configutils/*
- linters:
- lll
path: conditionutils/*
- linters:
- lll
path: testutils/*
- linters:
- dupl
path: cmdutils/*
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GOLANGCILINT ?= $(LOCALBIN)/golangci-lint
ADDLICENSE_VERSION ?= v1.1.1
GOIMPORTS_VERSION ?= v0.31.0
MOCKGEN_VERSION ?= v0.5.0
GOLANGCILINT_VERSION ?= v1.64
GOLANGCILINT_VERSION ?= v2.0

.PHONY: addlicense
addlicense: $(ADDLICENSE) ## Download addlicense locally if necessary.
Expand All @@ -95,4 +95,4 @@ $(MOCKGEN): $(LOCALBIN)
.PHONY: goimports
golangci-lint: $(GOLANGCILINT) ## Download golangci-lint locally if necessary.
$(GOLANGCILINT): $(LOCALBIN)
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCILINT_VERSION)
test -s $(LOCALBIN)/golangci-lint || GOBIN=$(LOCALBIN) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCILINT_VERSION)
2 changes: 1 addition & 1 deletion clientutils/clientutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func setObject(dst, src client.Object) error {
// IsOlderThan returns a function that determines whether an object is older than another.
func IsOlderThan(obj client.Object) func(other client.Object) (bool, error) {
return func(other client.Object) (bool, error) {
return obj.GetCreationTimestamp().Time.After(other.GetCreationTimestamp().Time), nil
return obj.GetCreationTimestamp().After(other.GetCreationTimestamp().Time), nil
}
}

Expand Down
2 changes: 1 addition & 1 deletion metautils/metautils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type BadList struct {

func (b *BadList) DeepCopyObject() runtime.Object {
return &BadList{
*b.ListMeta.DeepCopy(),
*b.DeepCopy(),
b.TypeMeta,
}
}
Expand Down
Loading