Skip to content

Instantly share code, notes, and snippets.

@berga
Forked from dmitryd/validate-yaml.txt
Created October 20, 2021 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berga/bc104df9c2af74fa67dcc0fe89efd3a8 to your computer and use it in GitHub Desktop.
Save berga/bc104df9c2af74fa67dcc0fe89efd3a8 to your computer and use it in GitHub Desktop.
Validate YAML file using Python one-liner
python -c 'import yaml,sys;yaml.safe_load(sys.stdin)' < file.yml
Needs "pip install pyyaml".
Source: https://liquidat.wordpress.com/2016/01/21/short-tip-verify-yaml-in-shell-via-python-one-liner/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment