gftools icon indicating copy to clipboard operation
gftools copied to clipboard

Builder: publish YAML schema files for config

Open m4rc1e opened this issue 4 years ago • 6 comments

gftools builder shouldn't run if build/config include parameters which are misspelled or not valid. Bonus points for suggesting fixes to spelling mistakes e.g buildotf is not a valid parameter. Did you mean buildOTF?

m4rc1e avatar Mar 16 '21 10:03 m4rc1e

@eliheuer don't know if you'd like to work on this? we can pair on it if you'd like? This isn't urgent but it's definitely something we'll need. Perhaps we'll tackle it once you start using the builder.

m4rc1e avatar Mar 16 '21 10:03 m4rc1e

That would be great! I have a meeting Friday I'm busy getting ready for but I'll work on this after that.

eliheuer avatar Mar 16 '21 16:03 eliheuer

@m4rc1e I made a PR for this here: https://github.com/googlefonts/gftools/pull/356

I spent some time reviewing Python error handling over the weekend, so pairing on this would be helpful if you have time. Thanks!

eliheuer avatar Apr 06 '21 18:04 eliheuer

Maybe related: Would it be possible to supply YAML schema files for the config yaml file? Something like https://github.com/googlefonts/gftools/blob/main/Lib/gftools/builder/schema.py but in yaml format itself. That would simplify editing config.yaml in editors which use the schema, e.g. VSCode.

jenskutilek avatar Jul 08 '21 12:07 jenskutilek

@jenskutilek Maybe that would be something the Google Fonts Unified Repository could include? https://github.com/googlefonts/Unified-Font-Repository

eliheuer avatar Jul 08 '21 16:07 eliheuer

It could even reside in a central location, VSCode can take a URL for yaml schemas used for validation:

https://gist.github.com/jenskutilek/42415ea048896a4cde81e5e5f9147b7b#file-settings-json-L58-L60

{
  "yaml.schemas": {
    "https://gist.githubusercontent.com/jenskutilek/1f93723fd3aed89810d61d5d6934b518/raw/6bd5f08614ad3368c8f3a66e86dd91dfd107380d/fontfabrik-v1.yaml": "*.fofa.yaml"
  }
}

jenskutilek avatar Jul 08 '21 21:07 jenskutilek

We've kind of done this using strictyaml, although now under builder2 build config files can be a lot more flexible.

simoncozens avatar Mar 14 '24 07:03 simoncozens