From 5624d2cbfda596545f5398ac99d5bb931ab186dc Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 30 Oct 2024 15:19:39 +0000 Subject: [PATCH] Add comments to linter exceptions Signed-off-by: Harald Albers --- cli/command/container/completion.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/command/container/completion.go b/cli/command/container/completion.go index 9103c05c8b..914de4e84d 100644 --- a/cli/command/container/completion.go +++ b/cli/command/container/completion.go @@ -197,7 +197,7 @@ func completeDetachKeys(_ *cobra.Command, _ []string, _ string) ([]string, cobra // The completion is partly composite. func completeIpc(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(toComplete) > 0 && strings.HasPrefix("container", toComplete) { //nolint:gocritic + if len(toComplete) > 0 && strings.HasPrefix("container", toComplete) { //nolint:gocritic // not swapped, matches partly typed "container" return []string{"container:"}, cobra.ShellCompDirectiveNoSpace } if strings.HasPrefix(toComplete, "container:") { @@ -237,7 +237,7 @@ func completeLogOpt(cmd *cobra.Command, _ []string, _ string) ([]string, cobra.S // completePid implements shell completion for the `--pid` option of `run` and `create`. func completePid(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(toComplete) > 0 && strings.HasPrefix("container", toComplete) { //nolint:gocritic + if len(toComplete) > 0 && strings.HasPrefix("container", toComplete) { //nolint:gocritic // not swapped, matches partly typed "container" return []string{"container:"}, cobra.ShellCompDirectiveNoSpace } if strings.HasPrefix(toComplete, "container:") { @@ -251,10 +251,10 @@ func completePid(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command // completeSecurityOpt implements shell completion for the `--security-opt` option of `run` and `create`. // The completion is partly composite. func completeSecurityOpt(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective) { - if len(toComplete) > 0 && strings.HasPrefix("apparmor=", toComplete) { //nolint:gocritic + if len(toComplete) > 0 && strings.HasPrefix("apparmor=", toComplete) { //nolint:gocritic // not swapped, matches partly typed "apparmor=" return []string{"apparmor="}, cobra.ShellCompDirectiveNoSpace } - if len(toComplete) > 0 && strings.HasPrefix("label", toComplete) { //nolint:gocritic + if len(toComplete) > 0 && strings.HasPrefix("label", toComplete) { //nolint:gocritic // not swapped, matches partly typed "label" return []string{"label="}, cobra.ShellCompDirectiveNoSpace } if strings.HasPrefix(toComplete, "label=") { @@ -265,7 +265,7 @@ func completeSecurityOpt(_ *cobra.Command, _ []string, toComplete string) ([]str return prefixWith("label=", labels), cobra.ShellCompDirectiveNoSpace | cobra.ShellCompDirectiveNoFileComp } // length must be > 1 here so that completion of "s" falls through. - if len(toComplete) > 1 && strings.HasPrefix("seccomp", toComplete) { //nolint:gocritic + if len(toComplete) > 1 && strings.HasPrefix("seccomp", toComplete) { //nolint:gocritic // not swapped, matches partly typed "seccomp" return []string{"seccomp="}, cobra.ShellCompDirectiveNoSpace } if strings.HasPrefix(toComplete, "seccomp=") {