Skip to content

Commit

Permalink
Update linter and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Aug 9, 2023
1 parent 984c790 commit 0516acf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# SPDX-License-Identifier: Apache-2.0

run:
deadline: 5m
deadline: 30m

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- depguard
# - depguard
- dogsled
- dupl
- errcheck
Expand Down Expand Up @@ -53,4 +53,5 @@ issues:
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- Using the variable on range scope `tc` in function literal
- "Using the variable on range scope `tc` in function literal"
- "unused-parameter: parameter"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all: generate license fix vet fmt test lint tidy
go install github.com/google/[email protected]

"$(MYGOBIN)/golangci-lint":
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3

"$(MYGOBIN)/deepcopy-gen":
go install k8s.io/code-generator/cmd/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions pkg/kstatus/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0

run:
deadline: 5m
deadline: 30m

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
Expand All @@ -11,7 +11,7 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
# - depguard
- dogsled
- dupl
- errcheck
Expand Down
7 changes: 3 additions & 4 deletions pkg/manifestreader/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ func SetNamespaces(mapper meta.RESTMapper, objs []*unstructured.Unstructured,
// of unknown types.
unknownGVKs = append(unknownGVKs, unknownTypeError.GroupVersionKind)
continue
} else {
// If something went wrong when looking up the scope, just
// give up.
return err
}
// If something went wrong when looking up the scope, just
// give up.
return err
}

switch scope {
Expand Down

0 comments on commit 0516acf

Please sign in to comment.