v3: accept multiple configurations
Author: pelageechCreated Nov 12, 2025Updated Nov 13, 2025
Hi! First, I want to say that mockery is a great tool for generating mocks. We have started using it in our monorepo recently, and there are multiple configurations for different projects (we decided that having one big config for everyone would be bad).
Due to the number of configs, we have to call mockery the same number of times, which is an overhead due to parsing the AST for each configuration. There aren't many .mockery.yml files right now, but I'm afraid that at some point, there might be more than 30 files, and the generation could take at least a minute.
I suggest that mockery should be able to accept multiple configurations. This would provide two benefits:
- Package caching would work between different configurations;
- All the packages across configurations would be parsed in parallel thanks to
golang.org/x/tools/go/packages.
Source: vektra/mockery