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

feat: Create validation context classes from schema.meta.context #2

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

effigies
Copy link
Contributor

Starting to think about how to write a Python validator that builds from the schema, rather than replicating the schema. Here's some bits that make it easy to generate structured classes for the validation context (schema.meta.context.context) based on either the bidsschematools schema or a schema loaded from JSON.

So far I have attrs classes that populate the context. It's unclear if it's worth doing something similar with the whole schema, which would be much more involved (patternProperties, additionalProperties, and the like).

Copy link

codecov bot commented May 28, 2024

Codecov Report

Attention: Patch coverage is 56.92308% with 84 lines in your changes missing coverage. Please review.

Project coverage is 74.87%. Comparing base (58732d1) to head (21cf04c).

Files with missing lines Patch % Lines
src/bids_validator/bidsignore.py 37.28% 35 Missing and 2 partials ⚠️
src/bids_validator/types/files.py 51.42% 34 Missing ⚠️
src/bids_validator/context_generator.py 79.03% 9 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main       #2       +/-   ##
===========================================
- Coverage   93.19%   74.87%   -18.33%     
===========================================
  Files           3        7        +4     
  Lines         191      386      +195     
  Branches       55      101       +46     
===========================================
+ Hits          178      289      +111     
- Misses          5       83       +78     
- Partials        8       14        +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pyproject.toml Outdated Show resolved Hide resolved
src/bids_validator/context.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant