From e85f6ab5fd358b93a92418448437c5e7bbaf2e68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:20:36 +0000 Subject: [PATCH] chore(deps): Bump github.com/vektra/mockery/v2 from 2.49.1 to 2.50.0 Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.49.1 to 2.50.0. - [Release notes](https://github.com/vektra/mockery/releases) - [Changelog](https://github.com/vektra/mockery/blob/master/docs/changelog.md) - [Commits](https://github.com/vektra/mockery/compare/v2.49.1...v2.50.0) --- updated-dependencies: - dependency-name: github.com/vektra/mockery/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../github.com/vektra/mockery/v2/.mockery.yaml | 16 +++++++++++++--- .../vektra/mockery/v2/mockery-tools.env | 2 +- .../vektra/mockery/v2/pkg/generator.go | 8 ++++++++ vendor/github.com/vektra/mockery/v2/pkg/parse.go | 5 +++-- vendor/modules.txt | 2 +- 7 files changed, 29 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 52669b2..ef60281 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 - github.com/vektra/mockery/v2 v2.49.1 + github.com/vektra/mockery/v2 v2.50.0 golang.org/x/crypto v0.29.0 ) diff --git a/go.sum b/go.sum index 04f3567..4e6527c 100644 --- a/go.sum +++ b/go.sum @@ -247,8 +247,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8 github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/temoto/robotstxt v1.1.1 h1:Gh8RCs8ouX3hRSxxK7B1mO5RFByQ4CmJZDwgom++JaA= github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= -github.com/vektra/mockery/v2 v2.49.1 h1:P33NkpxL5QNsteqdtOAEOJ94kKXaqdsTHeD6GtVuNUc= -github.com/vektra/mockery/v2 v2.49.1/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= +github.com/vektra/mockery/v2 v2.50.0 h1:0GYRH38nKiRghwUq+0aJXG1sT3yyTYj/J1xQRM8kGzQ= +github.com/vektra/mockery/v2 v2.50.0/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= diff --git a/vendor/github.com/vektra/mockery/v2/.mockery.yaml b/vendor/github.com/vektra/mockery/v2/.mockery.yaml index 56b7299..9a6171a 100644 --- a/vendor/github.com/vektra/mockery/v2/.mockery.yaml +++ b/vendor/github.com/vektra/mockery/v2/.mockery.yaml @@ -70,6 +70,15 @@ packages: mockname: "Mock{{.InterfaceName}}" outpkg: "{{.PackageName}}" inpackage: True + github.com/vektra/mockery/v2/pkg/fixtures/empty_return: + config: + all: True + dir: "{{.InterfaceDir}}" + mockname: "{{.InterfaceName}}Mock" + outpkg: "{{.PackageName}}" + filename: "mock_{{.InterfaceName}}_test.go" + inpackage: True + keeptree: False github.com/vektra/mockery/v2/pkg/fixtures/method_args/same_name_arg_and_type: config: all: True @@ -81,10 +90,12 @@ packages: keeptree: False github.com/vektra/mockery/v2/pkg/fixtures/iface_typed_param: config: *inpackage_config - github.com/vektra/mockery/v2/pkg/fixtures/example_project: + github.com/vektra/mockery/v2/pkg/fixtures/example_project: + config: *inpackage_config + github.com/vektra/mockery/v2/pkg/fixtures/index_list_expr: config: *inpackage_config github.com/vektra/mockery/v2/pkg/fixtures/issue845: - config: + config: <<: *inpackage_config filename: "mock_{{.MockName}}_test.go" interfaces: @@ -114,4 +125,3 @@ packages: mockname: Interface2WithUnresolvedAlias - resolve-type-alias: True mockname: Interface2WithResolvedAlias - diff --git a/vendor/github.com/vektra/mockery/v2/mockery-tools.env b/vendor/github.com/vektra/mockery/v2/mockery-tools.env index 9abcce5..a055998 100644 --- a/vendor/github.com/vektra/mockery/v2/mockery-tools.env +++ b/vendor/github.com/vektra/mockery/v2/mockery-tools.env @@ -1 +1 @@ -VERSION=v2.49.1 \ No newline at end of file +VERSION=v2.50.0 diff --git a/vendor/github.com/vektra/mockery/v2/pkg/generator.go b/vendor/github.com/vektra/mockery/v2/pkg/generator.go index 7058796..bcda68c 100644 --- a/vendor/github.com/vektra/mockery/v2/pkg/generator.go +++ b/vendor/github.com/vektra/mockery/v2/pkg/generator.go @@ -855,7 +855,11 @@ func (g *Generator) generateMethod(ctx context.Context, method *Method) { } g.printTemplate(data, ` +{{- if gt (len .Params.Names) 0}} // {{.FunctionName}} provides a mock function with given fields: {{join .Params.Names ", "}} +{{- else}} +// {{.FunctionName}} provides a mock function with no fields +{{- end}} func (_m *{{.MockName}}{{.InstantiatedTypeString}}) {{.FunctionName}}({{join .Params.Params ", "}}) {{if (gt (len .Returns.Types) 1)}}({{end}}{{join .Returns.Types ", "}}{{if (gt (len .Returns.Types) 1)}}){{end}} { {{- .Preamble -}} {{- if not .Returns.Types}} @@ -1009,7 +1013,11 @@ func (_c *{{.CallStruct}}{{ .InstantiatedTypeString }}) Return({{range .Returns. } func (_c *{{.CallStruct}}{{ .InstantiatedTypeString }}) RunAndReturn(run func({{range .Params.Types}}{{.}},{{end}})({{range .Returns.Types}}{{.}},{{end}})) *{{.CallStruct}}{{ .InstantiatedTypeString }} { +{{- if not .Returns.Types}} + _c.Run(run) +{{- else}} _c.Call.Return(run) +{{- end}} return _c } `) diff --git a/vendor/github.com/vektra/mockery/v2/pkg/parse.go b/vendor/github.com/vektra/mockery/v2/pkg/parse.go index 81ad0b4..cb73991 100644 --- a/vendor/github.com/vektra/mockery/v2/pkg/parse.go +++ b/vendor/github.com/vektra/mockery/v2/pkg/parse.go @@ -358,6 +358,7 @@ func (nv *NodeVisitor) DeclaredInterfaces() []string { func (nv *NodeVisitor) add(ctx context.Context, n *ast.TypeSpec) { log := zerolog.Ctx(ctx) log.Debug(). + Str("node-name", n.Name.Name). Str("node-type", fmt.Sprintf("%T", n.Type)). Msg("found node with acceptable type for mocking") nv.declaredInterfaces = append(nv.declaredInterfaces, n.Name.Name) @@ -379,10 +380,10 @@ func (nv *NodeVisitor) Visit(node ast.Node) ast.Visitor { break } nv.add(nv.ctx, n) - case *ast.InterfaceType, *ast.IndexExpr: + case *ast.InterfaceType, *ast.IndexExpr, *ast.IndexListExpr: nv.add(nv.ctx, n) default: - log.Debug().Msg("Found node with unacceptable type for mocking. Rejecting.") + log.Debug().Msg("found node with unacceptable type for mocking. Rejecting.") } } return nv diff --git a/vendor/modules.txt b/vendor/modules.txt index e0dfdc2..7d3e21b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -301,7 +301,7 @@ github.com/subosito/gotenv # github.com/temoto/robotstxt v1.1.1 ## explicit; go 1.11 github.com/temoto/robotstxt -# github.com/vektra/mockery/v2 v2.49.1 +# github.com/vektra/mockery/v2 v2.50.0 ## explicit; go 1.23 github.com/vektra/mockery/v2 github.com/vektra/mockery/v2/cmd