Open mkeeler opened 7 months ago
In theory, this could be done by the Config
object looking for go.mod
in the working directory and inferring from that. I want to make mockery more friendly to monorepo-style repos, but for now I don't see this particular feature as something that would dramatically improve quality of life.
I can leave it up for consideration. For the audience, vote up on it if you want this feature.
Description
I have a mockery config like:
I am placing a .mockery.yaml file into the sub-packages directory to control how that package generates mocks. It would be great if I could omit the packages and have
mockery
execute on the package within the same directory or if instead the package names could be templated. Something like the following would be nice:With that I could define a single configuration and run mockery within different packages to generate the mocks for that package.
I am trying to avoid having a single .mockery.yaml file for the entire repo as different parts of the repo are owned by different teams in my organization.
go list .
will output the current directories corresponding Go package so I assume it should be relatively simple to get it programmatically as well.Mockery Version
2.37.1
Golang Version
1.21
Installation Method
Steps to Reproduce
N/A
Expected Behavior
N/A
Actual Behavior
N/A