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

proposal: refactor configuration code #743

Open
06kellyjac opened this issue Oct 7, 2024 · 0 comments
Open

proposal: refactor configuration code #743

06kellyjac opened this issue Oct 7, 2024 · 0 comments

Comments

@06kellyjac
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently the code which loads default and user configuration has little in the way of validation.
Additionally the method of loading user or default config could be improved and values off the config can probably be accessed directly.

Describe the solution you'd like

Add config validation for both default and user config. Pick user or default config in a more elegant way.
Probably using a validation library such as zod or yup.
Then removing the getter functions and just accessing values off the object.

Describe alternatives you've considered

Could leave the code as is.

Could make the improvements above but follow a Class pattern like some of the rest of the code base giving a reason to keep the getter functions

Additional context

Currently some default config can not be overwritten from user config.
#742 addresses this but matching the current pattern used to have the issue resolved swiftly.
A refactor could avoid cases where some config accidentally can't be changed by the user

@06kellyjac 06kellyjac changed the title refactor configuration code proposal: refactor configuration code Oct 7, 2024
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

No branches or pull requests

1 participant