Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Schema for the cookiecutter 2.0 context format #1

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

klamann
Copy link
Member

@klamann klamann commented Apr 23, 2021

we want to be able to validate the new cookiecutter 2.0 context format, so here's a json schema for it.

also, validate it with the jsonschema lib and write a simple test
@klamann klamann self-assigned this Apr 23, 2021
lots of templates out there don't keep track of version numbers anyways
- changed the schema definition so "version" defines the version of the
cookiecutter schema and is a strict requirement
- cookiecutter_version is optional and defines the min required
cookiecutter version
- template_version describes the version number of the cookiecutter
template
- added descriptions for all schema fields
- validate() function improved, added the detect() function
- added documentation for these
- more unit tests
@klamann
Copy link
Member Author

klamann commented Apr 30, 2021

how can I find out which parts of the code are not yet covered by tests? 🤔

@louisdegaste
Copy link

louisdegaste commented Apr 30, 2021

how can I find out which parts of the code are not yet covered by tests? 🤔

In the tox report, it states the lines of the files which haven't been covered.
BTW: in the load_context() from context.py, there's already a comment saying that a bug in pytest coverage makes it miss a line for no reason

"$schema": "http://json-schema.org/draft-07/schema#",
"title": "cookiecutter-schema-1.0",
"type": "object",
# schema 1.0 is trivial: mapping from any variable name to a string or list of strings

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, there are some pre-defined fields, like extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants