The language server from Red Hat, that most editors use to have YAML syntax and intellisense, has support for JSON schemas.
This file is an attempt on such a schema. Would be nice to autogenerate these in the future, but having it at all is a nice first step. We might want to move this into the https://gitlab.dgc.local/tools/wharf-project project group, and optionally deploy and version this together with the https://gitlab.dgc.local/tools/wharf-project/cmd project...
-
Install the "YAML" extension (id:
redhat.vscode-yaml
, link: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) -
Add the following to your user settings:
"yaml.schemas":{ "https://gist.githubusercontent.com/jilleJr/07bcb76f86bcca3a398d42a51b3d303f/raw/5aec3157fbc1aecfb88fe3126c1e072bb40eba4f/wharf-ci-schema.json": [ ".wharf-ci.yml", ".dgc-ci.yml", ] },
-
Done! Open any
.wharf-ci.yml
file in some project and see it in action. Preview:
I've not found direct documentation of this, but it is possible according to the documentation to specify JSON schemas (as seen here: https://www.jetbrains.com/help/go/json.html#ws_json_schema_add_custom). RubyMine has documentation on specifying custom schemas (https://www.jetbrains.com/help/ruby/yaml.html#remote_json) so I'm thinking it could be possible, if you were so inclined to look for it in the settings. I do not have GoLand installed so I cannot verify.
Certificate issues. Some editors (such as VS Code) has their own certificate stores instead of using the systems certificate store. Instead of trying to work with that I just posted it here instead.