Checking files
A mistake in a resource file (an unknown key, a reference to a resource that does not exist, an expression that does not parse) otherwise shows only once a daemon loads the file, as a diagnostic in runy ns or the console. runy check finds it before: it reads the files in the CLI process, with no daemon, no state and no network, so it runs on a clean checkout.
runy checkIt checks the workspace enclosing the current folder and its declared sources, prints one line per finding (path:line:col: error|warning: message [id]) and a summary, and exits 1 when it found an error. The CLI reference lists what it checks and what it cannot know without running anything.
Sources loaded by hand
Section titled “Sources loaded by hand”A daemon remembers the folders loaded with runy load; runy check reads only the .runy.json of the workspace. Give it the other folders with --source, and their default namespace with --ns, as runy load takes them:
runy check --source tools/.runy --ns toolsTo check several workspaces, name their roots: runy check . ../other.
Install runy in the job and run runy check from the repository’s root; its exit code fails the job. --strict fails on warnings too, and --format json prints the findings as JSON for a step that annotates them.
curl -fsSL https://setup.runy.dev | shexport PATH="$HOME/.local/bin:$PATH"runy check --strictIn a pre-commit hook
Section titled “In a pre-commit hook”A Git hook that refuses a commit while the files have errors, in .git/hooks/pre-commit (made executable):
#!/bin/shexec runy checkWith the pre-commit framework, a local hook in .pre-commit-config.yaml:
repos: - repo: local hooks: - id: runy-check name: runy check entry: runy check language: system pass_filenames: false files: '(\.ya?ml|\.runy\.json)$'Editors
Section titled “Editors”runy schema prints a JSON Schema of a resource document, generated from the kinds the installed runy knows, so it matches its version. Write it to a file and point the YAML language server at it (VS Code’s YAML extension, and any editor that runs yaml-language-server):
runy schema -o .runy/schema.jsonruny schema --kind config -o .runy/config.schema.jsonA file names its schema in a comment on its first line; the schema applies to each document of the file:
# yaml-language-server: $schema=./schema.jsonkind: portname: webspec: preferred: 3000Or associate the files once, in VS Code’s settings.json:
{ "yaml.schemas": { ".runy/schema.json": [".runy/**/*.yaml", ".runy/**/*.yml"] }, "json.schemas": [ { "fileMatch": [".runy.json"], "url": "./.runy/config.schema.json" } ]}The editor then completes the keys of each kind’s spec once kind is set, and flags unknown keys and values of the wrong type. Any value may be a ${ ... } expression, which the schema accepts in place of a number, a boolean, a list or a mapping. Generate the schema again after upgrading runy.

