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

Adds directives validator #172

Draft
wants to merge 1 commit into
base: development
Choose a base branch
from
Draft

Adds directives validator #172

wants to merge 1 commit into from

Conversation

DT3264
Copy link
Collaborator

@DT3264 DT3264 commented Aug 7, 2023

Adds directives validator

To ease the testing, here's a link to an online go compiler, it is only needed to click "Fork this" to be able to modify the cpci.hdf file and try different directives combinantions

@DT3264 DT3264 mentioned this pull request Aug 7, 2023
@DT3264
Copy link
Collaborator Author

DT3264 commented Aug 7, 2023

@equetzal
I ask your review since the validator should validate every directive we currently support, though I feel like a review might come handy in case I forgot something or something else might be good to update / rethink.

I hardcoded the path to the hdf to ease testing on the GoLand ide but I'll update it to support receiving the directives file as an argument later on but before merging.

@DT3264 DT3264 requested a review from equetzal August 7, 2023 18:29
@equetzal
Copy link
Owner

equetzal commented Aug 7, 2023

@equetzal I ask your review since the validator should validate every directive we currently support, though I feel like a review might come handy in case I forgot something or something else might be good to update / rethink.

I hardcoded the path to the hdf to ease testing on the GoLand ide but I'll update it to support receiving the directives file as an argument later on but before merging.

Pretty new on Go too, I'll be needing some time to test this and better review it.
I've not seen the code but I'll say some facts on here that we need to check with the validator and if some is different on your code, we need to update them.

  • All sections must be present: [Always], [Event], [Event-Time], etc.
  • For timezones we need to have a set of valid strings a validate them to exist and be current according to IANA. E.g. America/Mexico_City
  • For XKBs keyboards we can also have a set of valid XKBs and check they exist on the system.
  • All the dates needs to follow the ISO standard in local timezone
  • All the time-windows (like Event-Times) needs to be before and after, if they do not match they're wrong.
  • All the time-windows needs to be at list 1 min wide.
  • The software also needs to be validated
  • The URLs needs to be well-formed URLs but we won't check existence of the web/file etc.
  • The wallpaper hashes can be validated by characters and length
  • All variables needs to be present to avoid empty directives

To ease the testing, [here's](https://onlinegdb.com/wkorOlpCk) a link to an online go compiler, it is only needed to click "Fork this" to be able to modify the cpci.hdf file and try different directives combinantions
@DT3264 DT3264 linked an issue Aug 10, 2023 that may be closed by this pull request
@DT3264 DT3264 marked this pull request as draft September 2, 2023 21:34
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

Successfully merging this pull request may close these issues.

Re-Implement Syntax Validator
2 participants