Skip to content

spirin/mockery-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mockery-proxy

A compatibility wrapper that enables v2-style CLI usage for mockery v3.

Purpose

mockery v3 removed support for direct CLI flags like --name, --inpackage, etc., and requires a YAML config file instead. This proxy allows to continue using the v2-style CLI syntax without needing to rewrite existing scripts or Makefiles.

mockery-proxy internally invokes the actual v2 command implementation from the github.com/vektra/mockery/v2/cmd package.

Installation

go install github.com/vektra/mockery/v3@v3
go install github.com/spirin/mockery-proxy@latest

Drop-in replacement

mv "$GOPATH/bin/mockery" "$GOPATH/bin/mockery3"
mv "$GOPATH/bin/mockery-proxy" "$GOPATH/bin/mockery"

Usage

v2-style CLI (internally handled via v2 logic)

with drop-in replacement:

mockery --name MyInterface --inpackage --case underscore ...etc

or without drop-in replacement:

mockery-proxy --name MyInterface --inpackage --case underscore ...etc

Behaves exactly as if you were using mockery v2.

v3-style passthrough

If the --config flag is passed, or no arguments are provided, the proxy forwards the call directly to the mockery v3 binary installed in your system.

with drop-in replacement:

mockery --config .mockery.yml
mockery

or without drop-in replacement:

mockery-proxy --config .mockery.yml
mockery-proxy

Commands like completion, help, init, migrate, showconfig, version are also passed to v3

License

MIT

About

A compatibility wrapper that enables v2-style CLI usage for mockery v3.

Resources

License

Stars

Watchers

Forks

Languages