-
Notifications
You must be signed in to change notification settings - Fork 60
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
Actual pattern validation? #9
Comments
I believe this could be achieved by recursively iterating json objects and lists until you reach the string and do a regex.compile as you say, I'm going to go with that because that's as much validation as you can do for those fields There is actually more validation we can do as specified in the schema, |
Great!! 👍 Thanks for tackling this. |
I believe the first undocumented examples are meant to be just that. Any match on the pattern assume that version string. IIRC I asked about that on the original project once upon a time. |
Is your feature request related to a problem? Please describe.
As part of the CI workflow for PRs (etc) would it be possible to validate the regex patterns or dom selectors ?
In the past we've found that upstream of AliasIO we encountered invalid regex patterns added to the technology files, or invalid selectors.
The two "normal" cases seemed to be:
There are plenty of other things that can make a regex or dom selector invalid, it would be good to catch and fix these early.
Describe the solution you'd like
I believe this could be added to the existing Python based validation. In Java a pattern can be compiled (Pattern.compile(String)) at which point an exception would be thrown if invalid. We also came up with something similar for DOM selectors. I assume something similar can be done with Python.
Describe alternatives you've considered
Additional context
Not sure what else to say here. Mainly I was thinking that catching potential errors as close to introduction as possible would be the easiest way to address/prevent them.
The text was updated successfully, but these errors were encountered: