This is a very draft-level initial commit of some template validation logic. At this stage, I am mostly pushing the files as a backup, and to trigger discussion.
This uses dry-validation to define a schema for the section of consult.yml that defines individual templates. In the current form, it does not validate the entire consult.yml file.
Goals
Provide visibility into obvious configuration errors (e.g., having no source or destination configured).
Encourage best practice configuration, such as setting a TTL.
Caveats
There are changes in here (bin/consult, as well as the ERB API change in template.rb) that are not related to template validation that I needed to make to get the code to run properly. I have not debugged why.
I rebased your PR on the latest changes from master, but I forgot to add the parameter to preserve the original author, so now it looks like I wrote the commit. We can fix that before merging though.
This is a very draft-level initial commit of some template validation logic. At this stage, I am mostly pushing the files as a backup, and to trigger discussion.
This uses
dry-validation
to define a schema for the section ofconsult.yml
that defines individual templates. In the current form, it does not validate the entireconsult.yml
file.Goals
Caveats
There are changes in here (
bin/consult
, as well as the ERB API change intemplate.rb
) that are not related to template validation that I needed to make to get the code to run properly. I have not debugged why.