Skip to content

Commit

Permalink
Merge pull request #548 from LandonTClipp/i_am_speed
Browse files Browse the repository at this point in the history
Add `packages` config: increases mock generation speed (5x)
  • Loading branch information
LandonTClipp authored Mar 5, 2023
2 parents 02edbfe + 82bc0c1 commit 16546bb
Show file tree
Hide file tree
Showing 77 changed files with 2,054 additions and 2,590 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ builds:
- main: ./main.go
binary: mockery
ldflags:
- -s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer=v{{.Version}}
- -s -w -X github.com/vektra/mockery/v2/pkg/logging.SemVer=v{{.Version}}
env:
- CGO_ENABLED=0
goos:
Expand Down
22 changes: 21 additions & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
quiet: False
all: True
keeptree: True
disable-version-string: True
with-expecter: True
filename: "{{.MockName}}.go"
packages:
github.com/vektra/mockery/v2/pkg:
interfaces:
TypesPackage:
github.com/vektra/mockery/v2/pkg/fixtures:
interfaces:
RequesterArgSameAsNamedImport:
RequesterVariadic:
config:
with-expecter: False
configs:
- structname: RequesterVariadicOneArgument
unroll-variadic: False
- structname: RequesterVariadic
Expecter:
RequesterReturnElided:



9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ fmt:
test: mocks
go test ./...

mocks: $(shell find . -type f -name '*.go' -not -name '*_test.go')
go run . --dir pkg/fixtures --output mocks/pkg/fixtures
go run . --all=false --print --dir pkg/fixtures --name RequesterVariadic --structname RequesterVariadicOneArgument --unroll-variadic=False > mocks/pkg/fixtures/RequesterVariadicOneArgument.go
go run . --all=false --print --dir pkg/fixtures --name Expecter --with-expecter > mocks/pkg/fixtures/Expecter.go
go run . --all=false --print --dir pkg/fixtures --name RequesterReturnElided --with-expecter > mocks/pkg/fixtures/RequesterReturnElided.go
@touch mocks
.PHONY: mocks
mocks:
go run .

.PHONY: install
install:
Expand Down
Loading

0 comments on commit 16546bb

Please sign in to comment.