Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] Config Parser Rewrite - Turn into a class #8

Open
Cameronsplaze opened this issue Aug 3, 2024 · 1 comment
Open

[Feature] Config Parser Rewrite - Turn into a class #8

Cameronsplaze opened this issue Aug 3, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Cameronsplaze
Copy link
Owner

Cameronsplaze commented Aug 3, 2024

Is your feature request related to a problem? Please describe.
This'll make the file MUCH easier to read, and expand on. For example, you can then delete keys from the file's dict as you parse them. That way if you typo one, and there's something left over, we can error to save the user on loads of debugging.

Describe the solution you'd like
Make the Config Parser file very readable/expandable. Turn it into a class. This'll make passing it around in python easier too. Can then expand into:

  • Error if there's any unused keys in the config.

Describe alternatives you've considered
Unless there's some config-parser library I haven't found yet, I'm not sure there is any alternative...

Additional context

@Cameronsplaze Cameronsplaze added enhancement New feature or request good first issue Good for newcomers labels Aug 3, 2024
@Cameronsplaze Cameronsplaze changed the title [Feature] Detect unused keys in config, and error [Feature] Config Parser Rewrite - Turn into a class Nov 1, 2024
@Cameronsplaze
Copy link
Owner Author

As apart of the re-write, now that you can link to specific headers in the examples readme (I.e https://github.com/Cameronsplaze/AWS-ContainerManager/blob/main/Examples/README.md#volumespathspath), add the url to the error if a key is missing! Something like passing Volumes[*].Paths[*].Path into some "required_to_exist" method will throw Error: {config_option} does not exist. Blah, more info at {url}#{config_option.lower().(remove_all_non_alpha)}

This is technically blocked by #69, but I'm working on that now. Came by this idea because of that re-write actually.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant