-
-
Notifications
You must be signed in to change notification settings - Fork 523
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
Refactor configuration retrieval/writing #1102
Comments
It looks pydantic could be promising for validating the config file when jrnl first loads. |
For #946 to work using ruamel.yaml, we'll need to deal with two different representations of the configuration:
One of the big innovations of ruamel seems to be around modifying just part of the YAML at once. We could take that approach, or keep loading the whole thing into memory then dumping it back. I don't think the performance implications are going to be significant either way so my impulse is to focus instead on maintainability wherever possible. |
This refactor should also at least leave open the ability to read different versions of the config file, and probably some sort of versioning applied to the default values when they're not in the config file. |
Feature Request
Use Case/Motivation
Down the road, we'd like to allow users to modify the config from the command line (#330, #1068) but currently our configuration code is a bit finnicky.
We also currently have a process in our code that is constantly rewriting the config file, when it probably shouldn't be.
And it'd be very nice to support and preserve detailed default comments in the config file (#946).
And, as we come up with new config keys and deprecate old ones, it would be nice to have defaults for various keys that never need to be expressed in the config file, rather than constantly adding a "config stew" of keys.
To resolve this issues, we're probably going to want to:
The text was updated successfully, but these errors were encountered: