Sha256: 6edc6e9084caf10a47ec5773695fc3b6958eb46208e2574c2706be03442013f2
Contents?: true
Size: 664 Bytes
Versions: 6
Compression:
Stored size: 664 Bytes
Contents
import sys import os import re status = 0 try: import yaml for root, dirs, files in os.walk("."): for f in files: # we want yaml files that are not in hidden (.) dirs or vendor directory. account for / vs \ on windows/linux target = os.path.join(root, f) if target.endswith(".yaml") and not re.match("^\.(/|\\\)(\.|vendor)", target): try: yaml.safe_load(open(target,"r")) except Exception as e: status = 1 print("YAML syntax error in %s: %s" % (target, str(e))) except ImportError as e: status = 1 print("Please install the python-yaml library: pip install pyyaml") sys.exit(status)
Version data entries
6 entries across 6 versions & 1 rubygems