Add Yaml Schema validation using yamale#28
Conversation
Signed-off-by: WolfGangS <flamin2k8@gmail.com>
HaroldCindy
left a comment
There was a problem hiding this comment.
Looks good! Just one question RE the ruff lint change.
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-yaml | ||
| args: [--allow-multiple-documents] |
There was a problem hiding this comment.
You mention that this is necessary because of something that yamale does, does yamale create json documents in the current directory that ruff then ends up picking up? Maybe better to not create those / create them in a working directory out of the source tree
There was a problem hiding this comment.
No, it's because of how the schema file for yamale works.
This line here https://github.com/secondlife/lsl-definitions/pull/28/files#diff-952095f3d61faa403ce145f93e4cf9887878a9a5f6cadcd0ce76db203ab7d6b7R7
That --- is yaml structure markup that means anything after is a "new " yaml document yamale uses the format to separate parts of the schema.
So the check-yaml step chokes on the schema file unless you allow multiple documents per file.
There was a problem hiding this comment.
Gotcha, that makes sense, approved!
This adds a schema document and a validation method for PR's to make sure that the
lsl_definitions.ymlfollows the so far agreed schema.It uses Yamale to perform the validation, which is installed by adding it as a requirement to the existing pyproject
There is also a small change to the config for the pre-commit action, as yamale uses multi-document yaml files for its validation method, so the pre-commits yaml check, needs to allow for this.
It also inclides 1 small change to the lsl_definitions.yml, to standardize a function, to match the rest, for the schema