Skip to content

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

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

Draft
wants to merge 28 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 82.49027% with 45 lines in your changes missing coverage. Please review.

Project coverage is 87.05%. Comparing base (a40bf21) to head (985542d).

Files with missing lines Patch % Lines
src/bids_validator/bidsignore.py 69.49% 14 Missing and 4 partials ⚠️
src/bids_validator/context_generator.py 75.80% 11 Missing and 4 partials ⚠️
src/bids_validator/types/files.py 84.28% 8 Missing and 3 partials ⚠️
tests/conftest.py 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #2      +/-   ##
==========================================
- Coverage   93.19%   87.05%   -6.15%     
==========================================
  Files           3       11       +8     
  Lines         191      448     +257     
  Branches       21       54      +33     
==========================================
+ Hits          178      390     +212     
- Misses          5       38      +33     
- Partials        8       20      +12     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

checks individual filenames
Adds FileTree class to walk through supplied directory
@ubdbra001 ubdbra001 mentioned this pull request Mar 14, 2025
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.

2 participants