-
Notifications
You must be signed in to change notification settings - Fork 225
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
Centralize the configuration handling #503
Comments
I got excited when I saw this subject thinking this was a PR. 😝 This is absolutely needed. It's a mess already! I'm just not sure what is the right way to redesign it. So many people have contributed code over the years that most of the code isn't mine anymore. It's a pain for me to get around the code, let alone someone brand new to the project. |
I just reread your post. That design could work! |
@seanthegeek I will work on the implementation then. |
Thinking about it more, having all options as a config object would break things for people who are using specific functions of |
@seanthegeek it can be done, however it will make the functions slightly more complex. I think it may be a better idea to think about which parts/functions of parsedmarc are used as standalone. Is parsedmarc meant to be a self-contained app or a utility library? |
Ideally it should be both, with some core functions used for parsing reports usable as a library, with some parts on top of that like mailbox monitoring being standalone. Separating those into |
With the configuration in a standalone class whose instance is passed to all functions, how about including the global dictionaries and caches (such as |
@seanthegeek I think @rodpayne's proposal is close to what you would like to see. |
Would something like dynaconf help here? |
@lingfish I would think so. @seanthegeek thoughts on https://www.dynaconf.com/? |
Just new getting around to looking at this. Dynaconf looks really nice! |
@seanthegeek if you are happy with the |
As
parsedmarc
's functionality gets richer, the functions' parameter lists are getting longer due to the config being parsed on top level and all the values are individually passed down in the call chain. This will yield enormous parameter lists over time.It would be great to extract the configuration into a standalone class, so it could be included in any depth and accessed in a more lightweight manner, reducing the amount of passed parameters.
The text was updated successfully, but these errors were encountered: