Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex filter not working for --name #497

Open
4 tasks
damiansima opened this issue Aug 12, 2022 · 2 comments
Open
4 tasks

Regex filter not working for --name #497

damiansima opened this issue Aug 12, 2022 · 2 comments

Comments

@damiansima
Copy link

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

  1. 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

@Agronis
Copy link

Agronis commented Nov 12, 2022

Have you tried wrapping in quotes? Works fine for me.

mockery --name="^.*SomethingThatMachersAnInterface"

@leaanthony-sc
Copy link
Contributor

The latest release includes this PR which may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants