Enable dupword linter
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
c5c636b7a9
commit
06bfcd658c
@ -13,6 +13,7 @@ linters:
|
||||
- unconvert
|
||||
- unused
|
||||
- vet
|
||||
- dupword # Checks for duplicate words in the source code
|
||||
disable:
|
||||
- errcheck
|
||||
|
||||
@ -34,7 +35,7 @@ linters-settings:
|
||||
# The following issues surfaced when `gosec` linter
|
||||
# was enabled. They are temporarily excluded to unblock
|
||||
# the existing workflow, but still to be addressed by
|
||||
# by future works.
|
||||
# future works.
|
||||
excludes:
|
||||
- G204
|
||||
- G305
|
||||
|
@ -240,7 +240,7 @@ func TestLogURIGenerator(t *testing.T) {
|
||||
{
|
||||
scheme: "binary",
|
||||
path: "C:\\path\\to\\binary",
|
||||
// NOTE: Windows paths should not be be parse-able outside of Windows:
|
||||
// NOTE: Windows paths should not be parse-able outside of Windows:
|
||||
err: "must be absolute",
|
||||
},
|
||||
})
|
||||
|
@ -204,6 +204,7 @@ type Stat struct {
|
||||
}
|
||||
|
||||
func parseStat(data string) (stat Stat, err error) {
|
||||
//nolint:dupword
|
||||
// From proc(5), field 2 could contain space and is inside `(` and `)`.
|
||||
// The following is an example:
|
||||
// 89653 (gunicorn: maste) S 89630 89653 89653 0 -1 4194560 29689 28896 0 3 146 32 76 19 20 0 1 0 2971844 52965376 3920 18446744073709551615 1 1 0 0 0 0 0 16781312 137447943 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||
|
@ -505,6 +505,7 @@ func (s *store) resumeStatus(ref string, total int64, digester digest.Digester)
|
||||
return status, fmt.Errorf("provided total differs from status: %v != %v", total, status.Total)
|
||||
}
|
||||
|
||||
//nolint:dupword
|
||||
// TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes
|
||||
fp, err := os.Open(data)
|
||||
if err != nil {
|
||||
|
@ -42,6 +42,7 @@ func TestGRPCRoundTrip(t *testing.T) {
|
||||
input: ErrNotFound,
|
||||
cause: ErrNotFound,
|
||||
},
|
||||
//nolint:dupword
|
||||
{
|
||||
input: fmt.Errorf("test test test: %w", ErrFailedPrecondition),
|
||||
cause: ErrFailedPrecondition,
|
||||
|
@ -132,7 +132,7 @@ func copyDesc(desc ocispec.Descriptor) *ocispec.Descriptor {
|
||||
return &descCopy
|
||||
}
|
||||
|
||||
// convertLayer converts image image layers if c.layerConvertFunc is set.
|
||||
// convertLayer converts image layers if c.layerConvertFunc is set.
|
||||
//
|
||||
// c.layerConvertFunc can be nil, e.g., for converting Docker media types to OCI ones.
|
||||
func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
|
||||
|
@ -283,7 +283,7 @@ func (m *DB) RegisterMutationCallback(fn func(bool)) {
|
||||
// RegisterCollectibleResource registers a resource type which can be
|
||||
// referenced by metadata resources and garbage collected.
|
||||
// Collectible Resources are useful ephemeral resources which need to
|
||||
// to be tracked by go away after reboot or process restart.
|
||||
// be tracked by go away after reboot or process restart.
|
||||
//
|
||||
// A few limitations to consider:
|
||||
// - Collectible Resources cannot reference other resources.
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
//nolint:dupword
|
||||
const procPIDStatus = `Name: cat
|
||||
Umask: 0022
|
||||
State: R (running)
|
||||
|
@ -366,7 +366,7 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe
|
||||
}
|
||||
|
||||
// Overrides the default snapshotter if Snapshotter is set for this runtime.
|
||||
// See See https://github.com/containerd/containerd/issues/6657
|
||||
// See https://github.com/containerd/containerd/issues/6657
|
||||
func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string {
|
||||
if ociRuntime.Snapshotter == "" {
|
||||
return c.config.ContainerdConfig.Snapshotter
|
||||
|
@ -1537,7 +1537,7 @@ func (in *instrumentedService) UpdateRuntimeConfig(ctx context.Context, r *runti
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
|
||||
} else {
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
|
||||
}
|
||||
}()
|
||||
res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r)
|
||||
@ -1553,7 +1553,7 @@ func (in *instrumentedAlphaService) UpdateRuntimeConfig(ctx context.Context, r *
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
|
||||
} else {
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
|
||||
}
|
||||
}()
|
||||
// converts request and response for earlier CRI version to call and get response from the current version
|
||||
|
@ -216,7 +216,7 @@ func (c *Controller) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe
|
||||
}
|
||||
|
||||
// Overrides the default snapshotter if Snapshotter is set for this runtime.
|
||||
// See See https://github.com/containerd/containerd/issues/6657
|
||||
// See https://github.com/containerd/containerd/issues/6657
|
||||
func (c *Controller) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string {
|
||||
if ociRuntime.Snapshotter == "" {
|
||||
return c.config.ContainerdConfig.Snapshotter
|
||||
|
@ -377,7 +377,7 @@ func (c *criService) runtimeSpec(id string, baseSpecFile string, opts ...oci.Spe
|
||||
}
|
||||
|
||||
// Overrides the default snapshotter if Snapshotter is set for this runtime.
|
||||
// See See https://github.com/containerd/containerd/issues/6657
|
||||
// See https://github.com/containerd/containerd/issues/6657
|
||||
func (c *criService) runtimeSnapshotter(ctx context.Context, ociRuntime criconfig.Runtime) string {
|
||||
if ociRuntime.Snapshotter == "" {
|
||||
return c.config.ContainerdConfig.Snapshotter
|
||||
|
@ -1537,7 +1537,7 @@ func (in *instrumentedService) UpdateRuntimeConfig(ctx context.Context, r *runti
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
|
||||
} else {
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
|
||||
}
|
||||
}()
|
||||
res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r)
|
||||
@ -1553,7 +1553,7 @@ func (in *instrumentedAlphaService) UpdateRuntimeConfig(ctx context.Context, r *
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
|
||||
} else {
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
|
||||
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
|
||||
}
|
||||
}()
|
||||
// converts request and response for earlier CRI version to call and get response from the current version
|
||||
|
@ -119,7 +119,7 @@ func splitDockerDomain(name string) (domain, remainder string) {
|
||||
}
|
||||
|
||||
// familiarizeName returns a shortened version of the name familiar
|
||||
// to to the Docker UI. Familiar names have the default domain
|
||||
// to the Docker UI. Familiar names have the default domain
|
||||
// "docker.io" and "library/" repository prefix removed.
|
||||
// For example, "docker.io/library/redis" will have the familiar
|
||||
// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp".
|
||||
|
Loading…
Reference in New Issue
Block a user