golangci-lint: revive: enable empty-lines

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-11-20 17:44:39 +01:00
parent 8e9aec6904
commit 9c0c49a5f2
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
12 changed files with 8 additions and 12 deletions

View File

@ -61,6 +61,14 @@ linters-settings:
- name: import-shadowing - name: import-shadowing
severity: warning severity: warning
disabled: false disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-block
- name: empty-block
severity: warning
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
- name: empty-lines
severity: warning
disabled: false
issues: issues:
# The default exclusion rules are a bit too permissive, so copying the relevant ones below # The default exclusion rules are a bit too permissive, so copying the relevant ones below

View File

@ -246,7 +246,6 @@ func copyFromContainer(ctx context.Context, dockerCli command.Cli, copyConfig cp
linkTarget, rebaseName = archive.GetRebaseName(srcPath, linkTarget) linkTarget, rebaseName = archive.GetRebaseName(srcPath, linkTarget)
srcPath = linkTarget srcPath = linkTarget
} }
} }
ctx, cancel := signal.NotifyContext(ctx, os.Interrupt) ctx, cancel := signal.NotifyContext(ctx, os.Interrupt)

View File

@ -265,7 +265,6 @@ size: 0B
assert.Equal(t, out.String(), tc.expected) assert.Equal(t, out.String(), tc.expected)
} }
}) })
} }
} }

View File

@ -166,7 +166,6 @@ func imageFormatTaggedAndDigest(ctx ImageContext, img image.Summary) []*imageCon
for _, dgst := range digests { for _, dgst := range digests {
addImage(repo, tag, dgst) addImage(repo, tag, dgst)
} }
} }
} }

View File

@ -39,7 +39,6 @@ func TestNetworkConnectErrors(t *testing.T) {
cmd.SetArgs(tc.args) cmd.SetArgs(tc.args)
cmd.SetOut(io.Discard) cmd.SetOut(io.Discard)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError) assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
} }
} }

View File

@ -139,7 +139,6 @@ func TestNetworkCreateErrors(t *testing.T) {
} }
cmd.SetOut(io.Discard) cmd.SetOut(io.Discard)
assert.ErrorContains(t, cmd.Execute(), tc.expectedError) assert.ErrorContains(t, cmd.Execute(), tc.expectedError)
} }
} }

View File

@ -90,7 +90,6 @@ func TestNetworkRemoveForce(t *testing.T) {
} else { } else {
assert.Check(t, is.Contains(fakeCli.ErrBuffer().String(), tc.expectedErr)) assert.Check(t, is.Contains(fakeCli.ErrBuffer().String(), tc.expectedErr))
assert.ErrorContains(t, err, "Code: 1") assert.ErrorContains(t, err, "Code: 1")
} }
}) })
} }

View File

@ -493,7 +493,6 @@ func (u *globalProgressUpdater) tasksByNode(tasks []swarm.Task) map[string]swarm
numberedStates[existingTask.Status.State] <= numberedStates[task.Status.State] { numberedStates[existingTask.Status.State] <= numberedStates[task.Status.State] {
continue continue
} }
} }
tasksByNode[task.NodeID] = task tasksByNode[task.NodeID] = task
} }

View File

@ -76,7 +76,6 @@ func runScale(dockerCli command.Cli, options *scaleOptions, args []string) error
} else { } else {
serviceIDs = append(serviceIDs, serviceID) serviceIDs = append(serviceIDs, serviceID)
} }
} }
if len(serviceIDs) > 0 { if len(serviceIDs) > 0 {

View File

@ -131,7 +131,6 @@ func TestIPNetBadQuoting(t *testing.T) {
} }
for i, test := range tests { for i, test := range tests {
var cidrs []net.IPNet var cidrs []net.IPNet
f := setUpIPNetFlagSet(&cidrs) f := setUpIPNetFlagSet(&cidrs)

View File

@ -340,7 +340,6 @@ func convertServiceConfigObjs(
ConfigName: name, ConfigName: name,
Runtime: &swarm.ConfigReferenceRuntimeTarget{}, Runtime: &swarm.ConfigReferenceRuntimeTarget{},
}) })
} }
confs, err := servicecli.ParseConfigs(apiClient, refs) confs, err := servicecli.ParseConfigs(apiClient, refs)
@ -441,7 +440,6 @@ func convertHealthcheck(healthcheck *composetypes.HealthCheckConfig) (*container
return &container.HealthConfig{ return &container.HealthConfig{
Test: []string{"NONE"}, Test: []string{"NONE"},
}, nil }, nil
} }
if healthcheck.Timeout != nil { if healthcheck.Timeout != nil {
timeout = time.Duration(*healthcheck.Timeout) timeout = time.Duration(*healthcheck.Timeout)

View File

@ -98,7 +98,6 @@ func (ep *Endpoint) ClientOpts() ([]client.Opt, error) {
withHTTPClient(tlsConfig), withHTTPClient(tlsConfig),
client.WithHost(ep.Host), client.WithHost(ep.Host),
) )
} else { } else {
result = append(result, result = append(result,
client.WithHTTPClient(&http.Client{ client.WithHTTPClient(&http.Client{