Editor support
Hod's pipeline format has a JSON Schema, so editors that speak YAML can complete keys, show what each one does on hover, and underline a key Hod doesn't know as you type.
Point your editor at the schema
Editors that use the YAML language server (VS Code with Red Hat's YAML extension, Neovim, Helix, Zed and others) read a comment on the first line of the file:
The schema comes with the hod command line, matching its version:
Commit that file next to the pipeline, so everyone working on the repository gets the same checks, and write it again after updating hod. The path in the comment is relative to the pipeline.
The docs site serves the schema of its own version too, at /schema/pipeline.json, for editors that fetch schemas by URL.
In JetBrains IDEs, add the file under Settings → Languages & Frameworks → Schemas and DTDs → JSON Schema Mappings, mapped to .hod/pipeline.yaml.
Job group files
The files under .hod/jobs/ that a pipeline takes jobs from (job groups) have a schema of their own, with one key, jobs::
Start each group file with # yaml-language-server: $schema=../jobs.schema.json (one more ../ per subfolder), or map the schema to the pattern .hod/jobs/**/*.yaml once in your editor's settings: yaml.schemas in VS Code, or a JSON Schema Mapping in JetBrains IDEs. The docs site serves it at /schema/jobs.json.
What the schema checks, and what it leaves to Hod
The schema checks the shape of a pipeline: which keys exist where, which values each one takes (timeout: 30m, a concurrency policy, an output type), and names such as job and service names. Keys planned but not in v0 yet are flagged, as hod validate flags them.
hod validate checks everything else, and is what decides:
- every CEL expression, type-checked against the event, the jobs a job needs and their outputs;
- the rules between keys, such as a step that has both
cache:andsecrets:; - jobs and components that a pipeline names but that don't exist;
- cycles in
needs:and invars:.
So a pipeline the editor accepts can still fail hod validate. The other way round shouldn't happen: what the editor underlines, hod validate refuses too. Hod's tests check the schema against the compiler; if you find a pipeline where they disagree, tell us (Feedback).