Created
June 22, 2017 17:57
-
-
Save topiaruss/827ecf8bc68612444c7f58ea79211ae2 to your computer and use it in GitHub Desktop.
A quick yaml syntax checker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup your fave virtual environment | |
pip install -r requirements.txt | |
python syntax.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PyYAML==3.12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Performs basic syntax checking for all the yml files in the current directory | |
import yaml | |
import glob | |
import os | |
if __name__ == '__main__': | |
for infile in [f for f in glob.glob('*.yml')]: | |
yy = open(infile, 'r') | |
parsed = yaml.load(yy) | |
# yaml.dump(parsed, os.sys.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment