mockery
mockery copied to clipboard
Regex filter not working for --name
Description
--name does not work as regex
Mockery Version
2.1.4.0
Golang Version
1.18
Installation Method
- [ ] Binary Distribution
- [ ] Docker
- [X ] brew
- [ ] go install
- [ ] Other: [specify]
Steps to Reproduce
- run mockery --name=^.*SomethingThatMachersAnInterface
Expected Behavior
A mock is generated
Actual Behavior
No mock generated as mockery prints
no matches found: --name=^.*SomethingThatMachersAnInterface
It think it may be related to this https://github.com/vektra/mockery/blob/master/cmd/mockery.go#L180 If name contains regex chars filter never assumes value
Have you tried wrapping in quotes? Works fine for me.
mockery --name="^.*SomethingThatMachersAnInterface"
The latest release includes this PR which may help.