refactor: remove types dependency #610
reviewdog [golangci] report
reported by reviewdog 🐶
Findings (57)
runtime/kubernetes/mock.go|143 col 53| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler
is not checked (errcheck)
runtime/kubernetes/pod_tracker.go|226 col 40| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler
is not checked (errcheck)
cmd/vela-worker/exec.go|29 col 1| cyclomatic complexity 31 of func (*Worker).exec
is high (> 30) (gocyclo)
mock/docker/system.go|24 col 35| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
mock/docker/system.go|33 col 32| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
mock/docker/node.go|22 col 42| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
internal/service/upload_test.go|165 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
internal/service/snapshot_test.go|137 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/pod_tracker_test.go|184 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
executor/local/build_test.go|470 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/local/build_test.go|515 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/build_test.go|1100 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/secret.go|209 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
executor/linux/secret.go|226 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
executor/linux/secret.go|243 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
mock/docker/container.go|127 col 9| SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
mock/docker/container.go|388 col 9| SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
mock/docker/container.go|397 col 9| SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
mock/docker/container.go|495 col 9| SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
mock/docker/container.go|503 col 9| SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
mock/docker/container.go|511 col 14| SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
mock/docker/network.go|40 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|47 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|56 col 10| SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
mock/docker/network.go|84 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|89 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|96 col 10| SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
mock/docker/network.go|176 col 9| SA1019: types.NetworksPruneReport is deprecated: use [network.PruneReport]. (staticcheck)
mock/docker/volume.go|173 col 9| SA1019: types.VolumesPruneReport is deprecated: use [volume.PruneReport]. (staticcheck)
runtime/docker/container.go|303 col 16| SA1019: types.ExecConfig is deprecated: use [container.ExecOptions]. (staticcheck)
runtime/docker/container.go|315 col 78| SA1019: types.ExecStartCheck is deprecated: use [container.ExecStartOptions] or [container.ExecAttachOptions]. (staticcheck)
runtime/docker/network.go|23 col 10| SA1019: types.NetworkCreate is deprecated: use [network.CreateOptions]. (staticcheck)
runtime/docker/network.go|45 col 10| SA1019: types.NetworkInspectOptions is deprecated: use [network.InspectOptions]. (staticcheck)
cmd/vela-worker/start.go|51 col 4| only one cuddle assignment allowed before if statement (wsl)
cmd/vela-worker/start.go|54 col 4| expressions should not be cuddled with blocks (wsl)
cmd/vela-worker/start.go|57 col 4| assignments should only be cuddled with other assignments (wsl)
cmd/vela-worker/start.go|58 col 4| only one cuddle assignment allowed before if statement (wsl)
cmd/vela-worker/start.go|61 col 4| return statements should not be cuddled if block has more than two lines (wsl)
cmd/vela-worker/start.go|70 col 3| expressions should not be cuddled with declarations or returns (wsl)
cmd/vela-worker/start.go|71 col 3| if statements should only be cuddled with assignments (wsl)
cmd/vela-worker/start.go|50 col 4| assignments should only be cuddled with other assignments (wsl)
executor/linux/build_test.go|605 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|1549 col 5| if statements should only be cuddled with assignments (wsl)
executor/linux/build_test.go|389 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|982 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|1605 col 4| if statements should only be cuddled with assignments (wsl)
executor/linux/build_test.go|1828 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|1483 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|165 col 5| only one cuddle assignment allowed before if statement (wsl)
executor/linux/build_test.go|207 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|202 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|322 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|697 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|945 col 6| only one cuddle assignment allowed before range statement (wsl)
internal/context/context_test.go|148 col 4| assignments should only be cuddled with other assignments (wsl)
runtime/kubernetes/pod_tracker_test.go|373 col 4| expressions should not be cuddled with blocks (wsl)
cmd/vela-worker/exec.go|28 col 1| directive //nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
is unused for linter "nilerr" (nolintlint)
Filtered Findings (0)
Annotations
Check failure on line 143 in runtime/kubernetes/mock.go
github-actions / golangci
[golangci] runtime/kubernetes/mock.go#L143
Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
Raw output
runtime/kubernetes/mock.go:143:53: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
c.PodTracker.podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
Check failure on line 226 in runtime/kubernetes/pod_tracker.go
github-actions / golangci
[golangci] runtime/kubernetes/pod_tracker.go#L226
Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
Raw output
runtime/kubernetes/pod_tracker.go:226:40: Error return value of `(k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler` is not checked (errcheck)
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
^
Check failure on line 29 in cmd/vela-worker/exec.go
github-actions / golangci
[golangci] cmd/vela-worker/exec.go#L29
cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
Raw output
cmd/vela-worker/exec.go:29:1: cyclomatic complexity 31 of func `(*Worker).exec` is high (> 30) (gocyclo)
func (w *Worker) exec(index int, config *api.Worker) error {
^
Check failure on line 24 in mock/docker/system.go
github-actions / golangci
[golangci] mock/docker/system.go#L24
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
mock/docker/system.go:24:35: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (s *SystemService) DiskUsage(ctx context.Context, opts types.DiskUsageOptions) (types.DiskUsage, error) {
^
Check failure on line 33 in mock/docker/system.go
github-actions / golangci
[golangci] mock/docker/system.go#L33
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
mock/docker/system.go:33:32: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (s *SystemService) Events(ctx context.Context, options types.EventsOptions) (<-chan events.Message, <-chan error) {
^
Check failure on line 22 in mock/docker/node.go
github-actions / golangci
[golangci] mock/docker/node.go#L22
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
mock/docker/node.go:22:42: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (n *NodeService) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) {
^
Check failure on line 165 in internal/service/upload_test.go
github-actions / golangci
[golangci] internal/service/upload_test.go#L165
unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
internal/service/upload_test.go:165:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
t.Run(test.name, func(t *testing.T) {
^
Check failure on line 137 in internal/service/snapshot_test.go
github-actions / golangci
[golangci] internal/service/snapshot_test.go#L137
unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
internal/service/snapshot_test.go:137:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
t.Run(test.name, func(t *testing.T) {
^
Check failure on line 184 in runtime/kubernetes/pod_tracker_test.go
github-actions / golangci
[golangci] runtime/kubernetes/pod_tracker_test.go#L184
unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/kubernetes/pod_tracker_test.go:184:25: unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
t.Run(test.name, func(t *testing.T) {
^
Check failure on line 470 in executor/local/build_test.go
github-actions / golangci
[golangci] executor/local/build_test.go#L470
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/local/build_test.go:470:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 515 in executor/local/build_test.go
github-actions / golangci
[golangci] executor/local/build_test.go#L515
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/local/build_test.go:515:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 1100 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1100
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/linux/build_test.go:1100:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 209 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L209
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:209:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 226 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L226
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:226:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 243 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L243
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:243:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 127 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L127
SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
Raw output
mock/docker/container.go:127:9: SA1019: types.ContainerExecInspect is deprecated: use [container.ExecInspect]. (staticcheck)
return types.ContainerExecInspect{}, nil
^
Check failure on line 388 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L388
SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
Raw output
mock/docker/container.go:388:9: SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
return types.ContainerPathStat{}, nil
^
Check failure on line 397 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L397
SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
Raw output
mock/docker/container.go:397:9: SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
return types.ContainerStats{}, nil
^
Check failure on line 495 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L495
SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
Raw output
mock/docker/container.go:495:9: SA1019: types.ContainersPruneReport is deprecated: use [container.PruneReport]. (staticcheck)
return types.ContainersPruneReport{}, nil
^
Check failure on line 503 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L503
SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
Raw output
mock/docker/container.go:503:9: SA1019: types.ContainerStats is deprecated: use [container.StatsResponseReader]. (staticcheck)
return types.ContainerStats{}, nil
^
Check failure on line 511 in mock/docker/container.go
github-actions / golangci
[golangci] mock/docker/container.go#L511
SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
Raw output
mock/docker/container.go:511:14: SA1019: types.ContainerPathStat is deprecated: use [container.PathStat]. (staticcheck)
return nil, types.ContainerPathStat{}, nil
^
Check failure on line 40 in mock/docker/network.go
github-actions / golangci
[golangci] mock/docker/network.go#L40
SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
Raw output
mock/docker/network.go:40:10: SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
return types.NetworkCreateResponse{}, errors.New("no network provided")
^
Check failure on line 47 in mock/docker/network.go
github-actions / golangci
[golangci] mock/docker/network.go#L47
SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
Raw output
mock/docker/network.go:47:10: SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
return types.NetworkCreateResponse{},
^
Check failure on line 56 in mock/docker/network.go
github-actions / golangci
[golangci] mock/docker/network.go#L56
SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
Raw output
mock/docker/network.go:56:10: SA1019: types.NetworkCreateResponse is deprecated: use [network.CreateResponse]. (staticcheck)
return types.NetworkCreateResponse{},
^
Check failure on line 84 in mock/docker/network.go
github-actions / golangci
[golangci] mock/docker/network.go#L84
SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
Raw output
mock/docker/network.go:84:10: SA1019: types.NetworkResource is deprecated: use [network.Inspect] or [network.Summary] (for list operations). (staticcheck)
return types.NetworkResource{}, errors.New("no network provided")
^