Skip to content

Validate / lint yaml

yamllint

Install:

apt install yamllint

Usage:

yamllint hiera/local1.yaml

v8r

A command-line JSON, YAML and TOML validator that's on your wavelength v8r is a command-line validator that uses Schema Store to detect a suitable schema for your input files based on the filename.

Usage:

npx v8r ...

Other linters

or

cat hiera/local1.yaml| shyaml get-values

cat .gitlab-ci.yml| ysh

Format/fix yaml

prettier l.yml
prettier --write l.yml

Sort yaml

https://github.com/ddebin/yaml-sort

npm install -g yaml-sort

Yaml formaters