From ca3b80eb0f6ff88f17d8b6e8adaea250358193c5 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Thu, 15 Aug 2024 13:19:47 -0400 Subject: [PATCH] CI: enable the whitespace linter Signed-off-by: Nalin Dahyabhai --- .golangci.yml | 1 + add.go | 1 - cmd/buildah/config.go | 1 - cmd/buildah/main.go | 1 - commit.go | 1 - new.go | 1 - pkg/cli/build.go | 1 - pkg/cli/common_test.go | 1 - pkg/parse/parse.go | 2 -- 9 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 4290f5412fc..8690fb4adb1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,3 +13,4 @@ linters: - revive - unconvert - unparam + - whitespace diff --git a/add.go b/add.go index a530154df07..f5a54a34d19 100644 --- a/add.go +++ b/add.go @@ -689,7 +689,6 @@ func (b *Builder) userForRun(mountPoint string, userspec string) (specs.User, st } else { u.AdditionalGids = groups } - } return u, homeDir, err } diff --git a/cmd/buildah/config.go b/cmd/buildah/config.go index ae1b471ed3a..796191e3132 100644 --- a/cmd/buildah/config.go +++ b/cmd/buildah/config.go @@ -386,7 +386,6 @@ func updateHealthcheck(builder *buildah.Builder, c *cobra.Command, iopts configR healthcheck.Retries = iopts.healthcheckRetries args = args + "--retries=" + strconv.Itoa(iopts.healthcheckRetries) + " " // args = fmt.Sprintf("%s --retries=%d ", args, iopts.healthcheckRetries) - } if c.Flag("healthcheck-start-period").Changed { duration, err := time.ParseDuration(iopts.healthcheckStartPeriod) diff --git a/cmd/buildah/main.go b/cmd/buildah/main.go index 0b0cf386e00..524d87b32b5 100644 --- a/cmd/buildah/main.go +++ b/cmd/buildah/main.go @@ -70,7 +70,6 @@ func init() { if err != nil { logrus.Error(err.Error()) os.Exit(1) - } if len(storageOptions.GraphDriverOptions) > 0 { diff --git a/commit.go b/commit.go index 0c15357447c..d8ee226e685 100644 --- a/commit.go +++ b/commit.go @@ -505,7 +505,6 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options return imgID, nil, "", err } logrus.Debugf("added imgID %s to manifestID %s", imgID, manifestID) - } return imgID, ref, manifestDigest, nil } diff --git a/new.go b/new.go index c07921684aa..2c8f1222373 100644 --- a/new.go +++ b/new.go @@ -243,7 +243,6 @@ func newBuilder(ctx context.Context, store storage.Store, options BuilderOptions suffixDigitsModulo := 100 for { - var flags map[string]interface{} // check if we have predefined ProcessLabel and MountLabel // this could be true if this is another stage in a build diff --git a/pkg/cli/build.go b/pkg/cli/build.go index 963ce14f228..18f9ff2834d 100644 --- a/pkg/cli/build.go +++ b/pkg/cli/build.go @@ -60,7 +60,6 @@ func GenBuildOptions(c *cobra.Command, inputArgs []string, iopts BuildOptions) ( if c.Flag("dns-search").Changed { return options, nil, nil, errors.New("the --dns-search option cannot be used with --network=none") } - } if c.Flag("tag").Changed { tags = iopts.Tag diff --git a/pkg/cli/common_test.go b/pkg/cli/common_test.go index 7449a6c512d..112b2664fe1 100644 --- a/pkg/cli/common_test.go +++ b/pkg/cli/common_test.go @@ -23,7 +23,6 @@ func testFlagCompletion(t *testing.T, flags pflag.FlagSet, flagCompletions compl t.Errorf(`Flag %q is a bool flag but has a shell completion function set. You have to remove this shell completion function.`, f.Name) return - } }) diff --git a/pkg/parse/parse.go b/pkg/parse/parse.go index 69ae6714dd2..0b5d92892db 100644 --- a/pkg/parse/parse.go +++ b/pkg/parse/parse.go @@ -250,7 +250,6 @@ func parseSecurityOpts(securityOpts []string, commonOpts *define.CommonBuildOpti default: return fmt.Errorf("invalid --security-opt 2: %q", opt) } - } if commonOpts.SeccompProfilePath == "" { @@ -1293,7 +1292,6 @@ func Secrets(secrets []string) (map[string]define.Secret, error) { SourceType: typ, } parsed[id] = newSecret - } return parsed, nil }