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

[WIP] Use specificaiton schemas to generate regex. #1126

Closed
wants to merge 4 commits into from
Closed

Conversation

rwblair
Copy link
Member

@rwblair rwblair commented Dec 8, 2020

As PRs like bids-standard/bids-specification#424 become more common, and require the regex in the validator to be updated, and as the regex gets more and more complicated it might be good to move towards automatically generated regex.

This adds a directory called schemas to the validator that has a complete set of the specifications schema files copied with cp from the current master specification. The index.js file in that directory will attempt to generate appropriate regex for valid filenames from the yaml files.

Thoughts and todos:

  • Still need to have validator use this regex, only played with it by hand so far.
  • There should be a npm command or bash script to handle generating both python and js regex and placing the generated files appropriately.
  • Find way for schema files to be tracked/copied when the specification changes, hopefully better than me calling cp.
  • See if the regex for subject and session level files can be reflected upstream in the specification's schema if not already.
  • Continuous and physio files can sneak into a lot of modalities, their regex are not currently able to be generated from the schemas.

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

Successfully merging this pull request may close these issues.

3 participants