Skip to content
Myr

validate_manual_schema.py

This file

Path

docs/validate_manual_schema.py

19 lines · 584 bytes · Python

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than fa6a2ff point at it.

website: remove unused root path on building website (#3248)itchynybefore adoptionfa6a2ff

lines 1–19why, one step back
1#!/usr/bin/env python3
2import jsonschema3import sys4import yaml56if len(sys.argv) < 2:7 sys.exit("Usage: {} MANUAL_FILE ...".format(sys.argv[0]))89with open("manual_schema.yml", "r") as schema_file:10 manual_schema = yaml.safe_load(schema_file)1112for path in sys.argv[1:]:13 with open(path, "r") as manual_file:14 manual_data = yaml.safe_load(manual_file)15 try:16 jsonschema.validate(instance=manual_data, schema=manual_schema)17 except jsonschema.exceptions.ValidationError as e:18 print("Failed to validate:", path, file=sys.stderr)19 sys.exit(e)