Open tobby-s opened 1 month ago
add a new template that indicates the .mockery.yaml location, e.g. {{.ConfigDir}}
This is a great idea and should be super easy to do. I approve of doing this, but I'm not sure when I'll have the time to get to it. Maybe in the next week or two unless anyone else wants to take it.
https://github.com/vektra/mockery/pull/807
do let me know of any other documenatation / tests etc i need to add.
Description
when the
dir
config is specified as not relative to the package (doesn't use{{.InterfaceDir}}
template), the generation is relative to the current working directory rather than the project root (or wherever .mockery.yaml is specified).Mockery Version
2.42.1
Go Version
1.22.3
Installation Method
Steps to Reproduce
.mockery.yaml
to mock an interface from an external go module, which is the use-case i'm encountering this issue), have/mocks
directory exist in project rootdir
tomocks
in.mockery.yaml
, e.g.:mockery
in project root thencd mocks
and run it againExpected Behavior
the second
mockery
shouldn't add any new files since config file was not changed between the two runsActual Behavior
new mocks are created in
mocks/mocks
Proposal
add a new template that indicates the
.mockery.yaml
location, e.g.{{.ConfigDir}}