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 ability for mockery to search up to root path for config file #527

Merged
merged 3 commits into from Dec 20, 2022
Merged

Add ability for mockery to search up to root path for config file #527

merged 3 commits into from Dec 20, 2022

Conversation

LandonTClipp
Copy link
Contributor

@LandonTClipp LandonTClipp commented Dec 20, 2022

Description

This adds the ability for mockery to iteratively search for a config file starting from the current working directory up to the root path. This is useful in cases where you use go generate and you don't want to re-specify command-line arguments multiple times.

Also added log line to indicate what config file was chosen:

20 Dec 22 15:10 CST INF Using config: /home/lclipp/git/vektra/mockery/.mockery.yaml dry-run=false version=v0.0.0-dev

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
  • 1.19

How Has This Been Tested?

go test ./...

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Mockery will iteratively search higher in the cwd tree for a config file
matching `.mockery.yaml`
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2022

Codecov Report

Base: 71.66% // Head: 72.06% // Increases project coverage by +0.40% 🎉

Coverage data is based on head (231d3d6) compared to base (847d988).
Patch coverage: 65.71% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #527      +/-   ##
==========================================
+ Coverage   71.66%   72.06%   +0.40%     
==========================================
  Files           6        6              
  Lines        1214     1235      +21     
==========================================
+ Hits          870      890      +20     
  Misses        301      301              
- Partials       43       44       +1     
Impacted Files Coverage Δ
cmd/showconfig.go 29.16% <0.00%> (-9.73%) ⬇️
cmd/mockery.go 28.39% <79.31%> (+6.90%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@LandonTClipp LandonTClipp merged commit 7402646 into vektra:master Dec 20, 2022
@LandonTClipp LandonTClipp deleted the config_search branch December 20, 2022 21:25
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.

None yet

2 participants