jupyter / enhancement-proposals

Enhancement proposals for the Jupyter Ecosystem
https://jupyter.org/enhancement-proposals
BSD 3-Clause "New" or "Revised" License
116 stars 65 forks source link

Validate JEP Front Matter against a Schema? #55

Open bollwyvl opened 4 years ago

bollwyvl commented 4 years ago

To help reduce the manual review time, and increase the impact of submissions to the JEP process, the validity of JEP front matter could be tested in CI.

A naive implementation, presupposing #54:

import yaml, pathlib, jsonschema

jep_schema = yaml.safe_load_all(
    pathlib.Path("jep-xxxx-jep-metadata.md"
).read_text())[0]

for jep in pathlib.Path().rglob("*.md):
    jsonschema.validate(
      yaml.safe_load_all(jep.read_text())[0], 
      jep_schema
    )

a more elegant approach would probably be a pytest fixture

choldgraf commented 4 years ago

I think it's a good idea! Anything that can reduce some editing/shepherding burden would help, I think. At least, we should require a minimal set of key/values. Perhaps we can begin with the set given by the metadata in the #29 JEP?