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

Feature Request: InterfaceNameLower as a template variable parameter. #670

Closed
hohmannr opened this issue Jul 11, 2023 · 2 comments
Closed
Labels
approved feature Feature request approved for development

Comments

@hohmannr
Copy link
Contributor

hohmannr commented Jul 11, 2023

Feature Request

I would like to see the addition of a template config variable called InterfaceNameLower, so that one could achieve more go standard library-esque file names for the mocks generated by mockery. The standard library primarily uses lowercase filenames for camelcased structs (e.g. fakeDB). To achieve the same with mockery, I would like to have the following configuration setup:

inpackage: True
filename: "{{.InterfaceNameLower}}_mock.go"
dir: "{{.InterfaceDir}}"
mockname: "Mock{{.InterfaceName}} "
packages:
  github.com/me/my-repo/pkg/datastore:
    interfaces:
      EventStorer:

This would the achieve that the following mock file is created: pkg/datastore/eventstorer_mock.go

I have not connected a PR for now, since in you state in your CONTRIBUTION guidelines to discuss the matter beforehand.
If this Feature Request will be accepted, I am willing to do the change myself and set you up with a PR. It should only be a simple change here along with a test-case that covers the new addition.

@LandonTClipp
Copy link
Collaborator

I have no problem at all with this, feel free to go ahead with the PR. Approved!

@LandonTClipp LandonTClipp added the approved feature Feature request approved for development label Jul 11, 2023
@hohmannr hohmannr mentioned this issue Jul 11, 2023
21 tasks
@hohmannr
Copy link
Contributor Author

@LandonTClipp here you go!

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

No branches or pull requests

2 participants