Skip to content

Commit 3f9f03a

Browse files
committed
Update depguard config
1 parent 9fb646d commit 3f9f03a

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

.golangci.yml

+17-10
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,23 @@ issues:
2121

2222
linters-settings:
2323
depguard:
24-
list-type: blacklist
25-
include-go-root: true
26-
packages-with-error-message:
27-
- sync/atomic: "Use go.uber.org/atomic instead of sync/atomic"
28-
- debug/elf: "Use github.com/parca-dev/parca/internal/go/debug/elf instead of debug/elf"
29-
- github.com/stretchr/testify/assert: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
30-
- log: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
31-
- github.com/go-kit/kit/log: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
32-
- github.com/go-logr/logr: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
33-
- github.com/pkg/errors: "Use fmt.Errorf instead"
24+
rules:
25+
Main:
26+
deny:
27+
- pkg: sync/atomic
28+
desc: "Use go.uber.org/atomic instead of sync/atomic"
29+
- pkg: debug/elf
30+
desc: "Use github.com/parca-dev/parca/internal/go/debug/elf instead of debug/elf"
31+
- pkg: github.com/stretchr/testify/assert
32+
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
33+
- pkg: log
34+
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
35+
- pkg: github.com/go-kit/kit/log
36+
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
37+
- pkg: github.com/go-logr/logr
38+
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
39+
- pkg: github.com/pkg/errors
40+
desc: "Use fmt.Errorf instead"
3441
errcheck:
3542
exclude: ./.errcheck_excludes.txt
3643
goimports:

filesystem.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ type FilesystemObjectiveServer struct {
276276
objectives *Objectives
277277
}
278278

279-
func (s *FilesystemObjectiveServer) List(ctx context.Context, req *connect.Request[objectivesv1alpha1.ListRequest]) (*connect.Response[objectivesv1alpha1.ListResponse], error) {
279+
func (s *FilesystemObjectiveServer) List(_ context.Context, req *connect.Request[objectivesv1alpha1.ListRequest]) (*connect.Response[objectivesv1alpha1.ListResponse], error) {
280280
var matchers []*labels.Matcher
281281
if expr := req.Msg.Expr; expr != "" {
282282
var err error

kubernetes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func init() {
5757
// +kubebuilder:scaffold:scheme
5858
}
5959

60-
func cmdKubernetes(logger log.Logger, metricsAddr string, configMapMode, genericRules bool) int {
60+
func cmdKubernetes(logger log.Logger, metricsAddr string, _, genericRules bool) int {
6161
setupLog := ctrl.Log.WithName("setup")
6262
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
6363

kubernetes/api/v1alpha1/servicelevelobjective_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (in *ServiceLevelObjective) ValidateCreate() (admission.Warnings, error) {
168168
return in.validate()
169169
}
170170

171-
func (in *ServiceLevelObjective) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
171+
func (in *ServiceLevelObjective) ValidateUpdate(_ runtime.Object) (admission.Warnings, error) {
172172
return in.validate()
173173
}
174174

kubernetes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var (
7373

7474
type mockClient struct{}
7575

76-
func (m *mockClient) List(_ context.Context, list client.ObjectList, opts ...client.ListOption) error {
76+
func (m *mockClient) List(_ context.Context, list client.ObjectList, _ ...client.ListOption) error {
7777
switch l := list.(type) {
7878
case *pyrrav1alpha1.ServiceLevelObjectiveList:
7979
l.Items = append(l.Items, o1)

0 commit comments

Comments
 (0)