Skip to content

Commit 9cbea6f

Browse files
mxpvthaJeztah
authored andcommitted
Enable dupword linter
Signed-off-by: Maksym Pavlenko <[email protected]> (cherry picked from commit 06bfcd6) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c73f1ab commit 9cbea6f

9 files changed

Lines changed: 11 additions & 6 deletions

File tree

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ linters:
1313
- unconvert
1414
- unused
1515
- vet
16+
- dupword # Checks for duplicate words in the source code
1617
disable:
1718
- errcheck
1819

@@ -27,7 +28,7 @@ linters-settings:
2728
# The following issues surfaced when `gosec` linter
2829
# was enabled. They are temporarily excluded to unblock
2930
# the existing workflow, but still to be addressed by
30-
# by future works.
31+
# future works.
3132
excludes:
3233
- G204
3334
- G305

cmd/containerd-stress/density.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ type Stat struct {
198198
}
199199

200200
func parseStat(data string) (stat Stat, err error) {
201+
//nolint:dupword
201202
// From proc(5), field 2 could contain space and is inside `(` and `)`.
202203
// The following is an example:
203204
// 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

cmd/containerd/command/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ can be used and modified as necessary as a custom configuration.`
187187
// run server initialization in a goroutine so we don't end up blocking important things like SIGTERM handling
188188
// while the server is initializing.
189189
// As an example opening the bolt database will block forever if another containerd is already running and containerd
190-
// will have to be be `kill -9`'ed to recover.
190+
// will have to be `kill -9`'ed to recover.
191191
chsrv := make(chan srvResp)
192192
go func() {
193193
defer close(chsrv)

content/local/store.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ func (s *store) resumeStatus(ref string, total int64, digester digest.Digester)
505505
return status, fmt.Errorf("provided total differs from status: %v != %v", total, status.Total)
506506
}
507507

508+
//nolint:dupword
508509
// TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes
509510
fp, err := os.Open(data)
510511
if err != nil {

errdefs/grpc_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestGRPCRoundTrip(t *testing.T) {
4242
input: ErrNotFound,
4343
cause: ErrNotFound,
4444
},
45+
//nolint:dupword
4546
{
4647
input: fmt.Errorf("test test test: %w", ErrFailedPrecondition),
4748
cause: ErrFailedPrecondition,

images/converter/default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func copyDesc(desc ocispec.Descriptor) *ocispec.Descriptor {
132132
return &descCopy
133133
}
134134

135-
// convertLayer converts image image layers if c.layerConvertFunc is set.
135+
// convertLayer converts image layers if c.layerConvertFunc is set.
136136
//
137137
// c.layerConvertFunc can be nil, e.g., for converting Docker media types to OCI ones.
138138
func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {

pkg/cap/cap_linux_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func TestFromBitmap(t *testing.T) {
8989
}
9090

9191
func TestParseProcPIDStatus(t *testing.T) {
92+
//nolint:dupword
9293
procPIDStatus := `Name: cat
9394
Umask: 0022
9495
State: R (running)

pkg/cri/server/instrumented_service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ func (in *instrumentedService) UpdateRuntimeConfig(ctx context.Context, r *runti
15041504
if err != nil {
15051505
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
15061506
} else {
1507-
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
1507+
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
15081508
}
15091509
}()
15101510
res, err = in.c.UpdateRuntimeConfig(ctrdutil.WithNamespace(ctx), r)
@@ -1520,7 +1520,7 @@ func (in *instrumentedAlphaService) UpdateRuntimeConfig(ctx context.Context, r *
15201520
if err != nil {
15211521
log.G(ctx).WithError(err).Error("UpdateRuntimeConfig failed")
15221522
} else {
1523-
log.G(ctx).Debug("UpdateRuntimeConfig returns returns successfully")
1523+
log.G(ctx).Debug("UpdateRuntimeConfig returns successfully")
15241524
}
15251525
}()
15261526
// converts request and response for earlier CRI version to call and get response from the current version

reference/docker/reference.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ func splitDockerDomain(name string) (domain, remainder string) {
683683
}
684684

685685
// familiarizeName returns a shortened version of the name familiar
686-
// to to the Docker UI. Familiar names have the default domain
686+
// to the Docker UI. Familiar names have the default domain
687687
// "docker.io" and "library/" repository prefix removed.
688688
// For example, "docker.io/library/redis" will have the familiar
689689
// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp".

0 commit comments

Comments
 (0)