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
(This issue replaces #32, #29 and #28 in order to have one place to discuss this general feature)
confique can emit "config templates" which contain the documentation, the default values and various other information. By deriving Serialize for your config, you can also write a loaded config back to file via serde -- without any documentation or other information though! It would be nice to write a template file, but with values coming from a loaded configuration. There are a few different use cases/requirements (random unordered sorts follow):
Library users should be able to control whether non-set values should be emitted (with #value = "foo" and docs) or not at all.
Apps with a config-UI would want to set one value in the Partial-tree probably, and then write that to the config.
Users of this library that are not interested in the feature, shouldn't pay in compile times for unused Serialize code
It seems to me that this requires a few things:
Probably some dynamic way to index into a configuration. I don't want to generate a whole bunch of code for this use case for every struct field. Have to think about this more.
Maybe ability to get a list of layers from the builder? Or should people just not use the builder if they need explicit control over layers?
Editing existing config files requires special support like toml-edit.
None of these use cases are promised to land in confique. Especially the "edit existing file" seems very hard to me and I'm not sure if it's worth it.
The text was updated successfully, but these errors were encountered:
(This issue replaces #32, #29 and #28 in order to have one place to discuss this general feature)
confique
can emit "config templates" which contain the documentation, the default values and various other information. By derivingSerialize
for your config, you can also write a loaded config back to file viaserde
-- without any documentation or other information though! It would be nice to write a template file, but with values coming from a loaded configuration. There are a few different use cases/requirements (random unordered sorts follow):git config set
-like workflows that should not overwrite the whole config, but only edit a particular value. (Would you consider modification of config files? #29)Config
, but rather aPartial
, so that default values will stay#value = "foo"
in the config, and notvalid = "foo"
. (Automatic support forskip_serializing_if
on each field #28)#value = "foo"
and docs) or not at all.Partial
-tree probably, and then write that to the config.Serialize
codeIt seems to me that this requires a few things:
toml-edit
.None of these use cases are promised to land in
confique
. Especially the "edit existing file" seems very hard to me and I'm not sure if it's worth it.The text was updated successfully, but these errors were encountered: