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

Add --inpackage-suffix option #453

Merged

Conversation

grongor
Copy link
Contributor

@grongor grongor commented Apr 19, 2022

This allows users to choose whether they prefer mock_name.go or name_mock.go for their filenames.

Description

I've seen this issue and it seemed like an easy pick, so here we are :D

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Version of Golang used when building/testing:

  • 1.11
  • 1.12
  • 1.13
  • 1.14
  • 1.15
  • 1.16
  • 1.17
  • 1.18

How Has This Been Tested?

Run tests, tried make mocks, and it looks ok :)

This allows users to choose whether they prefer mock_name.go or
name_mock.go for their filenames.
@codecov-commenter
Copy link

Codecov Report

Merging #453 (c98782f) into master (aad3571) will increase coverage by 0.12%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##           master     #453      +/-   ##
==========================================
+ Coverage   70.76%   70.89%   +0.12%     
==========================================
  Files           7        7              
  Lines        1293     1302       +9     
==========================================
+ Hits          915      923       +8     
- Misses        325      326       +1     
  Partials       53       53              
Impacted Files Coverage Δ
cmd/mockery.go 21.73% <50.00%> (+0.24%) ⬆️
pkg/outputter.go 37.70% <100.00%> (+8.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aad3571...c98782f. Read the comment docs.

@LandonTClipp
Copy link
Contributor

Thanks for the PR, and the great contributions in general. For this particular one, I'm not super excited to field obscure requests that don't really affect the usability or functionality of the project, as that leads to bloat. If it became a highly requested feature it'd be a different story, but I'm leaning towards a pass for now.

@grongor
Copy link
Contributor Author

grongor commented Apr 22, 2022

Yeah, I can understand that. I'm personally not using the --inpackage option, so I don't really care, but I must say that if I wanted to use it, I'd definitely opt-in for the suffix (so that the relevant files are "close to each other").

@YonitLopatinski
Copy link

Will this fix be merged??

@mgjules
Copy link

mgjules commented Dec 18, 2022

Can someone please merge it? or is there a blocking issue?

Copy link
Contributor

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only 10 months late, I'm deciding to approve this. Seems like enough people want this feature :) Will merge when tests pass.

@LandonTClipp LandonTClipp merged commit e543651 into vektra:master Feb 9, 2023
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

Successfully merging this pull request may close these issues.

Make it configurable if the filename addition "mock" is prefixed or postfixed
6 participants