Skip to content

Instantly share code, notes, and snippets.

@dmitryd
Last active February 8, 2022 10:15
Show Gist options
  • Save dmitryd/791c6860660a68736e199891909f9710 to your computer and use it in GitHub Desktop.
Save dmitryd/791c6860660a68736e199891909f9710 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/
@johnstcn
Copy link

@tdsan you have a duplicated close parenthesis, it should work if you remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment