Skip to content

Commit

Permalink
Update golangci/golangci-lint to v1.56.2
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Dec 13, 2024
1 parent b79c5f6 commit 7c4852e
Show file tree
Hide file tree
Showing 50 changed files with 919 additions and 813 deletions.
6 changes: 3 additions & 3 deletions api/filters/replacement/replacement.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ func copyValueToTarget(target *yaml.RNode, value *yaml.RNode, selector *types.Ta
Path: kyaml_utils.SmarterPathSplitter(fp, "."),
Create: createKind})
if err != nil {
return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0))
return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) //nolint:govet
}
targetFields, err := targetFieldList.Elements()
if err != nil {
return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0))
return errors.WrapPrefixf(err, fieldRetrievalError(fp, createKind != 0)) //nolint:govet
}
if len(targetFields) == 0 {
return errors.Errorf(fieldRetrievalError(fp, createKind != 0))
return errors.Errorf(fieldRetrievalError(fp, createKind != 0)) //nolint:govet
}

for _, t := range targetFields {
Expand Down
2 changes: 1 addition & 1 deletion api/internal/accumulator/resaccumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (ra *ResAccumulator) FixBackReferences() (err error) {

// Intersection drops the resources which "other" does not have.
func (ra *ResAccumulator) Intersection(other resmap.ResMap) error {
otherIds := other.AllIds()
otherIds := other.AllIds() //nolint:revive
for _, curId := range ra.resMap.AllIds() {
toDelete := true
for _, otherId := range otherIds {
Expand Down
11 changes: 6 additions & 5 deletions api/internal/builtins/HelmChartInflationGenerator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion api/internal/builtins/NamespaceTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PatchJson6902Transformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/builtins/PatchTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions api/internal/builtins/SortOrderTransformer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/internal/git/repospec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func TestNewRepoSpecFromUrl_Smoke(t *testing.T) {
rs.Dir = ""
rs.Submodules = false
rs.Timeout = 0
assert.Equal(t, &tc.repoSpec, rs)
assert.Equal(t, &tc.repoSpec, rs) //nolint:gosec
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/internal/loader/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (fl *FileLoader) New(path string) (ifc.Loader, error) {
}
root, err := filesys.ConfirmDir(fl.fSys, fl.root.Join(path))
if err != nil {
return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error())
return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) //nolint:govet
}
if err = fl.errIfGitContainmentViolation(root); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion api/internal/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func NewLoader(
}
root, err := filesys.ConfirmDir(fSys, target)
if err != nil {
return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error())
return nil, errors.WrapPrefixf(err, ErrRtNotDir.Error()) //nolint:govet
}
return newLoaderAtConfirmedDir(
lr, root, fSys, nil, git.ClonerUsingGitExec), nil
Expand Down
1 change: 1 addition & 0 deletions api/internal/plugins/execplugin/execplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) {
}
result, err := cmd.Output()
if err != nil {
//nolint:govet
return nil, errors.WrapPrefixf(
fmt.Errorf("failure in plugin configured via %s; %w",
f.Name(), err), stdErr.String())
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/internal/commands/cat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require" //nolint:depguard
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
"sigs.k8s.io/kustomize/kyaml/copyutil"
"sigs.k8s.io/kustomize/kyaml/filesys"
"sigs.k8s.io/kustomize/kyaml/filesys" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/openapi"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/config/internal/commands/count_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require" //nolint:depguard
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
"sigs.k8s.io/kustomize/kyaml/copyutil"
"sigs.k8s.io/kustomize/kyaml/filesys"
"sigs.k8s.io/kustomize/kyaml/filesys" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/openapi"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/config/internal/commands/e2e/e2econtainerconfig/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strconv"

"sigs.k8s.io/kustomize/kyaml/fn/framework"
"sigs.k8s.io/kustomize/kyaml/fn/framework/command"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/fn/framework/command" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/kio" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/yaml"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"fmt"
"os"

"sigs.k8s.io/kustomize/kyaml/fn/framework"
"sigs.k8s.io/kustomize/kyaml/fn/framework/command"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
"sigs.k8s.io/kustomize/kyaml/fn/framework" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/fn/framework/command" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/kio" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/yaml" //nolint:depguard
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"fmt"
"os"

"sigs.k8s.io/kustomize/kyaml/fn/framework"
"sigs.k8s.io/kustomize/kyaml/fn/framework/command"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
"sigs.k8s.io/kustomize/kyaml/fn/framework" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/fn/framework/command" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/kio" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/yaml" //nolint:depguard
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import (
"fmt"
"os"

"sigs.k8s.io/kustomize/kyaml/fn/framework"
"sigs.k8s.io/kustomize/kyaml/fn/framework/command"
"sigs.k8s.io/kustomize/kyaml/kio"
"sigs.k8s.io/kustomize/kyaml/yaml"
"sigs.k8s.io/kustomize/kyaml/fn/framework" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/fn/framework/command" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/kio" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/yaml" //nolint:depguard
)

type App struct {
Metadata struct {
Name string `yaml:"name"`
} `yaml:"metadata"`
Spec struct {
Port int `yaml:"port" json:"port"`
Port int `yaml:"port" json:"port"` //nolint:tagalign
} `yaml:"spec" json:"spec"`
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/config/internal/commands/grep.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type GrepRunner struct {

func (r *GrepRunner) preRunE(c *cobra.Command, args []string) error {
if len(args) == 0 {
return fmt.Errorf("missing required argument: QUERY")
return fmt.Errorf("missing required argument: QUERY") //nolint:perfsprint
}
r.GrepFilter.Compare = func(a, b string) (int, error) {
qa, err := resource.ParseQuantity(a)
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/internal/commands/grep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require" //nolint:depguard
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
"sigs.k8s.io/kustomize/kyaml/copyutil"
"sigs.k8s.io/kustomize/kyaml/filesys"
"sigs.k8s.io/kustomize/kyaml/filesys" //nolint:depguard
)

// TestGrepCommand_files verifies grep reads the files and filters them
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/internal/commands/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require" //nolint:depguard
"sigs.k8s.io/kustomize/kyaml/runfn"
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/config/internal/commands/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ spec:
selector:
app: nginx
`), 0600)
//nolint:testifylint
if !assert.NoError(t, err) {
return
}
Expand All @@ -635,6 +636,7 @@ spec:
r := commands.GetTreeRunner("")
r.Command.SetArgs([]string{"--image"})
r.Command.SetOut(b)
//nolint:testifylint
if !assert.NoError(t, r.Command.Execute()) {
return
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/depprobcheck/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ require (
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
6 changes: 2 additions & 4 deletions cmd/depprobcheck/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -495,8 +494,7 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
4 changes: 2 additions & 2 deletions cmd/gorepomod/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ require (
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
Expand Down
Loading

0 comments on commit 7c4852e

Please sign in to comment.