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

Enable goverter:enum on goverter:variables mode #155

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

sublee
Copy link
Contributor

@sublee sublee commented Aug 9, 2024

Thanks for this nice project. goverter saves a lot of my time.

goverter v1.5.0 has introduced the goverter:variables conversion mode. In this mode, goverter:enum turns off unexpectedly. goverter:enum should be enabled by default by the documentation.

enum [yes|no] can be defined as CLI argument or conversion comment. enum is enabled per default.

I investigated the issue and guessed the reason for this problem. There are two default configurations DefaultConfigInterface and DefaultConfigVariables which turn on goverter:enum. DefaultConfigInterface is used for the goverter:converter mode as its name indicates, but DefaultConfigVariables is not used for the goverter:variables mode.

This patch enables DefaultConfigVariables for the goverter:variables mode to fix the problem. You can prove it by var_enum.yml test scenario I added. This scenario fails without this patch.

Thank you.

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.53%. Comparing base (b046455) to head (efefb02).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #155      +/-   ##
==========================================
- Coverage   96.53%   96.53%   -0.01%     
==========================================
  Files          46       46              
  Lines        2253     2250       -3     
==========================================
- Hits         2175     2172       -3     
  Misses         53       53              
  Partials       25       25              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for the contribution and the detailed reasoning!

@jmattheis jmattheis merged commit 551dbe9 into jmattheis:main Aug 9, 2024
7 checks passed
@sublee sublee deleted the default-config-variables branch August 9, 2024 18:56
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.

2 participants