canonical / hotsos

Software analysis toolkit. Define checks in high-level language and leverage library to perform analysis of common Cloud applications.
Apache License 2.0
31 stars 37 forks source link

Write a schema for scenario YAML files #953

Open mustafakemalgilor opened 1 month ago

mustafakemalgilor commented 1 month ago

YAML schemas allow code completion and highlighting for many IDEs and editors, including Eclipse, VS Code, IntelliJ, Emacs, and vim. They're usually stored in a central registry such as https://www.schemastore.org/json/.

A proper YAML schema can make it easier to write scenarios and allow IDEs to lint the scenario files on the fly.

mustafakemalgilor commented 1 month ago

For this, we'd probably have to switch to an "identifiable" file extension, e.g. ".hotsos.yaml".

nicolasbock commented 1 month ago

Instead of file name, would a particular key/value work too? Something like

hotsos-schema: v1
mustafakemalgilor commented 1 month ago

Instead of file name, would a particular key/value work too? Something like

There are schema specification methods for different plugins (comments, specific YAML key) but I couldn't find a common denominator. I'll research more.