cli icon indicating copy to clipboard operation
cli copied to clipboard

Add option for checking receipe format

Open arejula27 opened this issue 1 year ago • 3 comments

Sometimes the gh action takes 5 minutes and then fails because of a wrong recipe format. This rating time can be avoided by adding a static checker before running everything, also users can use it locally as a githook so they never commit a wrong receipe

arejula27 avatar Jul 28 '24 08:07 arejula27

This is planned, we'll have JSONSchema validation, the schema repo is here: https://github.com/blue-build/schema This will also support validation inside your code editor, if it supports YAML LSP.

xynydev avatar Jul 28 '24 09:07 xynydev

I was thinking also to add a version field, similar to kubernetes files, where the first line says which version uses the file

arejula27 avatar Jul 28 '24 09:07 arejula27

Since a standard comment line linking the schema is needed for LSP support, I thought that that could also encode the recipe format version: # yaml-language-server: $schema=https://schema.blue-build.org/recipe-v1.json ^ that is the line I'm using currently for testing

#180 is where we're planning recipe v2 and we'll probably roll out the schema validation at the same time as that.

xynydev avatar Jul 28 '24 10:07 xynydev

Added in #239

gmpinder avatar Nov 14 '24 05:11 gmpinder