Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: golangci-lint doesn't check api and client modules #51761

@thaJeztah

Description

@thaJeztah

Description

I was curious why CI didn't flag the incorrect GoDoc comment;

Then noticed that it just doesn't run on the api and client modules (sigh...)

From the root of the repository (inside the dev container (make shell));

golangci-lint run -v
# no failures

When changing to the api or client directory;

cd api
golangci-lint run -v --config=../.golangci.yml

INFO [runner] linters took 2.503358126s with stages: goanalysis_metalinter: 2.500504168s
types/swarm/task.go:151:2: structtag: struct field tag `json:MemorySwappiness,omitzero"` not compatible with reflect.StructTag.Get: bad syntax for struct tag value (govet)
	MemorySwappiness *int64 `json:MemorySwappiness,omitzero"`
	^
types/jsonstream/message.go:5:1: ST1021: comment on exported type Message should be of the form "Message ..." (with optional leading article) (staticcheck)
// JSONMessage defines a message struct. It describes
^
cd client
golangci-lint run -v --config=../.golangci.yml

client/system_disk_usage.go:275:3: missing cases in switch of type container.ContainerState: container.StateCreated, container.StateRemoving, container.StateExited, container.StateDead (exhaustive)
		switch c.State {
		^
client/container_export.go:15:6: identical: interface 'ContainerExportResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerLogsResult, ImageImportResult, ImageLoadResult, ImageSaveResult, ServiceLogsResult, TaskLogsResult) (iface)
type ContainerExportResult interface {
     ^
client/container_logs.go:26:6: identical: interface 'ContainerLogsResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ImageImportResult, ImageLoadResult, ImageSaveResult, ServiceLogsResult, TaskLogsResult) (iface)
type ContainerLogsResult interface {
     ^
client/image_import.go:12:6: identical: interface 'ImageImportResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ContainerLogsResult, ImageLoadResult, ImageSaveResult, ServiceLogsResult, TaskLogsResult) (iface)
type ImageImportResult interface {
     ^
client/image_load.go:12:6: identical: interface 'ImageLoadResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ContainerLogsResult, ImageImportResult, ImageSaveResult, ServiceLogsResult, TaskLogsResult) (iface)
type ImageLoadResult interface {
     ^
client/image_pull.go:17:6: identical: interface 'ImagePullResponse' contains identical methods or type constraints with another interface, causing redundancy (see: ImagePushResponse) (iface)
type ImagePullResponse interface {
     ^
client/image_push.go:20:6: identical: interface 'ImagePushResponse' contains identical methods or type constraints with another interface, causing redundancy (see: ImagePullResponse) (iface)
type ImagePushResponse interface {
     ^
client/image_save.go:9:6: identical: interface 'ImageSaveResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ContainerLogsResult, ImageImportResult, ImageLoadResult, ServiceLogsResult, TaskLogsResult) (iface)
type ImageSaveResult interface {
     ^
client/service_logs.go:28:6: identical: interface 'ServiceLogsResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ContainerLogsResult, ImageImportResult, ImageLoadResult, ImageSaveResult, TaskLogsResult) (iface)
type ServiceLogsResult interface {
     ^
client/task_logs.go:26:6: identical: interface 'TaskLogsResult' contains identical methods or type constraints with another interface, causing redundancy (see: ContainerExportResult, ContainerLogsResult, ImageImportResult, ImageLoadResult, ImageSaveResult, ServiceLogsResult) (iface)
type TaskLogsResult interface {
     ^
client/container_exec.go:8:2: import "github.com/containerd/errdefs" imported without alias but must be with alias "cerrdefs" according to config (importas)
	"github.com/containerd/errdefs"
	^
client/container_exec_test.go:9:2: import "github.com/containerd/errdefs" imported without alias but must be with alias "cerrdefs" according to config (importas)
	"github.com/containerd/errdefs"
	^
client/container_rename.go:8:2: import "github.com/containerd/errdefs" imported without alias but must be with alias "cerrdefs" according to config (importas)
	"github.com/containerd/errdefs"
	^
client/pkg/security/security_opts_test.go:8:2: import "gotest.tools/v3/assert/cmp" imported without alias but must be with alias "is" according to config (importas)
	"gotest.tools/v3/assert/cmp"
	^
client/volume_prune.go:9:2: import "github.com/containerd/errdefs" imported without alias but must be with alias "cerrdefs" according to config (importas)
	"github.com/containerd/errdefs"
	^
client/volume_prune_test.go:8:2: import "github.com/containerd/errdefs" imported without alias but must be with alias "cerrdefs" according to config (importas)
	"github.com/containerd/errdefs"
	^
client/client_test.go:367:5: ineffectual assignment to err (ineffassign)
	_, err = client.Ping(t.Context(), PingOptions{
	   ^
client/client_test.go:381:5: ineffectual assignment to err (ineffassign)
	_, err = client.Ping(t.Context(), PingOptions{
	   ^
client/client_test.go:425:5: ineffectual assignment to err (ineffassign)
	_, err = client.Ping(t.Context(), PingOptions{
	   ^
client/container_exec_test.go:153:19: use-errors-new: replace fmt.Errorf by errors.New (revive)
						return nil, fmt.Errorf("should not have made API request")
						            ^
client/container_exec_test.go:10:2: ST1019(related information): other import of "github.com/containerd/errdefs" (staticcheck)
	cerrdefs "github.com/containerd/errdefs"
	^
client/client_options.go:136:25: func testRoundTripper.skipConfigureTransport is unused (unused)
func (testRoundTripper) skipConfigureTransport() bool { return true }
                        ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testinggo-moduleskind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions