Skip to content

v2.21.4 gives error regarding --filename or --structname even though I am not using it #572

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

Closed
1 of 5 tasks
mohdaqib57 opened this issue Mar 9, 2023 · 1 comment · Fixed by #622
Closed
1 of 5 tasks
Labels

Comments

@mohdaqib57
Copy link

Description

I am getting this error FTL Cannot specify --filename or --structname with regex in --name dry-run=false version=v2.21.4.

However, I dont call for filename and structname since I first use mockery for few years.

This is the command that I execute mockery --name='(.*)' --case=underscore --dir=src/lib/redis --output=src/lib/redis/mocks.

The config file I use since v2.21.0 is as below

packages:
  github.com/vektra/mockery/v2/pkg:
    config:
      all: True

Mockery Version

v2.21.4

Golang Version

1.19.1

Installation Method

  • Binary Distribution
  • Docker
  • brew
  • go install
  • Other: [specify]

Steps to Reproduce

  1. Run the mockery command as above mockery --name='(.*)' --case=underscore --dir=src/lib/redis --output=src/lib/redis/mocks (change directory for own test)
  2. You will get the error

Expected Behavior

No error

Actual Behavior

get error FTL Cannot specify --filename or --structname with regex in --name dry-run=false version=v2.21.4.

@LandonTClipp
Copy link
Collaborator

Hi, so you are using --name which enters the code into the legacy behavior. The packages config should not be specified along with --name. What is happening to you is that the code is getting into a split-brain situation. I think I should make this more clear, so I will leave this open to make sure the code will fail under this scenario.

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

Successfully merging a pull request may close this issue.

2 participants