mirror of https://github.com/docker/cli.git
golangci-lint: enable dupword linter
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2d61f70f00
commit
7e9d2c78c6
|
@ -3,6 +3,7 @@ linters:
|
|||
- bodyclose
|
||||
- depguard
|
||||
- dogsled
|
||||
- dupword # Detects duplicate words.
|
||||
- gocyclo
|
||||
- gofumpt
|
||||
- goimports
|
||||
|
|
|
@ -24,7 +24,7 @@ const (
|
|||
pidsHeader = "PIDS" // Used only on Linux
|
||||
)
|
||||
|
||||
// StatsEntry represents represents the statistics data collected from a container
|
||||
// StatsEntry represents the statistics data collected from a container
|
||||
type StatsEntry struct {
|
||||
Container string
|
||||
Name string
|
||||
|
|
|
@ -44,6 +44,8 @@ type EndpointDefaultResolver interface {
|
|||
// the lack of a default (e.g. because the config file which
|
||||
// would contain it is missing). If there is no default then
|
||||
// returns nil, nil, nil.
|
||||
//
|
||||
//nolint:dupword // ignore "Duplicate words (nil,) found"
|
||||
ResolveDefault() (interface{}, *store.EndpointTLSData, error)
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ image tag2 imageID2 N/A 0B
|
|||
Format: NewImageFormat("table {{.Repository}}", false, false),
|
||||
},
|
||||
},
|
||||
"REPOSITORY\nimage\nimage\n<none>\n",
|
||||
"REPOSITORY\nimage\nimage\n<none>\n", //nolint:dupword // ignore "Duplicate words (image) found"
|
||||
},
|
||||
{
|
||||
ImageContext{
|
||||
|
@ -169,7 +169,7 @@ image <none>
|
|||
Format: NewImageFormat("table {{.Repository}}", true, false),
|
||||
},
|
||||
},
|
||||
"REPOSITORY\nimage\nimage\n<none>\n",
|
||||
"REPOSITORY\nimage\nimage\n<none>\n", //nolint:dupword // ignore "Duplicate words (image) found"
|
||||
},
|
||||
{
|
||||
ImageContext{
|
||||
|
@ -284,7 +284,7 @@ image_id: imageID3
|
|||
Format: NewImageFormat("{{.Repository}}", false, false),
|
||||
},
|
||||
},
|
||||
"image\nimage\n<none>\n",
|
||||
"image\nimage\n<none>\n", //nolint:dupword // ignore "Duplicate words (image) found"
|
||||
},
|
||||
{
|
||||
ImageContext{
|
||||
|
@ -293,7 +293,7 @@ image_id: imageID3
|
|||
},
|
||||
Digest: true,
|
||||
},
|
||||
"image\nimage\n<none>\n",
|
||||
"image\nimage\n<none>\n", //nolint:dupword // ignore "Duplicate words (image) found"
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ const (
|
|||
//
|
||||
// minwidth minimal cell width including any padding
|
||||
// tabwidth width of tab characters (equivalent number of spaces)
|
||||
// padding padding added to a cell before computing its width
|
||||
// padding the padding added to a cell before computing its width
|
||||
// padchar ASCII char used for padding
|
||||
// if padchar == '\t', the Writer will assume that the
|
||||
// width of a '\t' in the formatted output is tabwidth,
|
||||
|
|
|
@ -213,6 +213,7 @@ func TestHistoryContext_Table(t *testing.T) {
|
|||
{ID: "imageID6", Created: oldDate, CreatedBy: "/bin/bash echo", Size: int64(182964289), Comment: "Hi", Tags: []string{"image:tag2"}},
|
||||
}
|
||||
|
||||
//nolint:dupword // ignore "Duplicate words (CREATED) found"
|
||||
const expectedNoTrunc = `IMAGE CREATED CREATED BY SIZE COMMENT
|
||||
imageID1 24 hours ago /bin/bash ls && npm i && npm run test && karma -c karma.conf.js start && npm start && more commands here && the list goes on 183MB Hi
|
||||
imageID2 24 hours ago /bin/bash echo 183MB Hi
|
||||
|
@ -221,6 +222,7 @@ imageID4 24 hours ago /bin/bash grep
|
|||
imageID5 N/A /bin/bash echo 183MB Hi
|
||||
imageID6 17 years ago /bin/bash echo 183MB Hi
|
||||
`
|
||||
//nolint:dupword // ignore "Duplicate words (CREATED) found"
|
||||
const expectedTrunc = `IMAGE CREATED CREATED BY SIZE COMMENT
|
||||
imageID1 24 hours ago /bin/bash ls && npm i && npm run test && kar… 183MB Hi
|
||||
imageID2 24 hours ago /bin/bash echo 183MB Hi
|
||||
|
|
|
@ -71,7 +71,7 @@ func ParseConfigs(client client.ConfigAPIClient, requestedConfigs []*swarmtypes.
|
|||
}
|
||||
|
||||
// the configRefs map has two purposes: it prevents duplication of config
|
||||
// target filenames, and it it used to get all configs so we can resolve
|
||||
// target filenames. It is used to get all configs, so we can resolve
|
||||
// their IDs. unfortunately, there are other targets for ConfigReferences,
|
||||
// besides just a File; specifically, the Runtime target, which is used for
|
||||
// CredentialSpecs. Therefore, we need to have a list of ConfigReferences
|
||||
|
|
|
@ -1365,7 +1365,7 @@ func updateCredSpecConfig(flags *pflag.FlagSet, containerSpec *swarm.ContainerSp
|
|||
// otherwise, set the credential spec to be the parsed value
|
||||
credSpec := credSpecOpt.Value.(*credentialSpecOpt).Value()
|
||||
|
||||
// if this is a Config credential spec, we we still need to replace the
|
||||
// if this is a Config credential spec, we still need to replace the
|
||||
// value of credSpec.Config with the config ID instead of Name.
|
||||
if credSpec.Config != "" {
|
||||
for _, config := range containerSpec.Configs {
|
||||
|
|
|
@ -1056,7 +1056,7 @@ func TestUpdateGetUpdatedConfigs(t *testing.T) {
|
|||
},
|
||||
}
|
||||
// cannedConfigRefs is the same thing, but with config references instead
|
||||
// instead of ID, however, it just maps an arbitrary string value. this is
|
||||
// of ID, however, it just maps an arbitrary string value. this is
|
||||
// so we could have multiple config refs using the same config
|
||||
cannedConfigRefs := map[string]*swarm.ConfigReference{
|
||||
"fooRef": {
|
||||
|
|
|
@ -262,8 +262,8 @@ func GetSignableRoles(repo client.Repository, target *client.Target) ([]data.Rol
|
|||
return signableRoles, nil
|
||||
}
|
||||
|
||||
// there are delegation roles, find every delegation role we have a key for, and
|
||||
// attempt to sign into into all those roles.
|
||||
// there are delegation roles, find every delegation role we have a key for,
|
||||
// and attempt to sign in to all those roles.
|
||||
for _, delegationRole := range allDelegationRoles {
|
||||
// We do not support signing any delegation role that isn't a direct child of the targets role.
|
||||
// Also don't bother checking the keys if we can't add the target
|
||||
|
|
Loading…
Reference in New Issue