YAML Check

Run yq to validate and lint YAML files for correctness

controlplaneio-fluxcd Updated

File contents

YAML Check

Use yq to validate and inspect YAML files.

Usage

To validate a single YAML file:

yq eval '.' file.yaml > /dev/null

To validate all YAML files in a directory:

./scripts/validation.sh /path/to/dir

To pretty-print a YAML file:

yq eval '.' file.yaml

Common Options

  • -e EXPRESSION — evaluate a yq expression
  • -i — edit file in-place
  • -o json — output as JSON
  • -P — pretty-print output

controlplaneio-fluxcd/flux-operator/tree/main/config/testdata/skills/yaml-check commit 0e4a00772a

Frequently asked questions

npx skillmds@latest add controlplaneio-fluxcd/yaml-check