You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Lefhook git hooks manager we had ability to skip some git hooks in user's local config. That was done via skip boolean setting in the config where usually it wasn't specified in main config defaulting to false, but in local config user could set it to true. However, reverse situations also exists in the wild.
Recently we decided to allow users not only skip hooks always (true) or never (false) but also by more complex conditions (e.g. during rebase and merge). This means, that this setting now can have different types of values in different configs: either boolean, string, or list of strings.
However, when we tried to merge configs with these “multitype” setting, values were ignored. I'm not sure whether it is a bug in Viper (I couldn't find any reasoning for the current implementation), but at least surprising behavior. If there is a way to properly handle this situation without changing Viper, please let us know!
Expected behavior (what you expected to happen):
When I merge two configs with keys of different types, values are being overriden by values from merging config.
Actual behavior (what actually happened):
New values are ignored with following messages printed to stderr:
Anything else we should know?:
Pull request in Lefthook where this behavior was discovered (more context can be found here): evilmartians/lefthook#173
Similar issue in Viper: #1134
Commit that introduces code of interest: 991d18a
And thank you for Viper!
The text was updated successfully, but these errors were encountered:
A maintainer will take a look at your issue shortly. 👀
In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues.
📣 If you've already given us your feedback, you can still help by spreading the news,
either by sharing the above link or telling people about this on Twitter:
In Lefhook git hooks manager we had ability to skip some git hooks in user's local config. That was done via
skip
boolean setting in the config where usually it wasn't specified in main config defaulting tofalse
, but in local config user could set it totrue
. However, reverse situations also exists in the wild.Recently we decided to allow users not only skip hooks always (
true
) or never (false
) but also by more complex conditions (e.g. duringrebase
andmerge
). This means, that this setting now can have different types of values in different configs: either boolean, string, or list of strings.However, when we tried to merge configs with these “multitype” setting, values were ignored. I'm not sure whether it is a bug in Viper (I couldn't find any reasoning for the current implementation), but at least surprising behavior. If there is a way to properly handle this situation without changing Viper, please let us know!
Expected behavior (what you expected to happen):
When I merge two configs with keys of different types, values are being overriden by values from merging config.
Actual behavior (what actually happened):
New values are ignored with following messages printed to stderr:
Repl.it link:
https://replit.com/@Envek/Viper-example#main.go
Code reproducing the issue:
Configuration files:
lefthook.yml
lefthook-local.yml
Environment:
Anything else we should know?:
Pull request in Lefthook where this behavior was discovered (more context can be found here): evilmartians/lefthook#173
Similar issue in Viper: #1134
Commit that introduces code of interest:
991d18a
And thank you for Viper!
The text was updated successfully, but these errors were encountered: