bids-validator icon indicating copy to clipboard operation
bids-validator copied to clipboard

[WIP] Function to load json sidecar and functions to evaluate different rule types.

Open rwblair opened this issue 3 years ago • 0 comments

In an effort to forward #1478 this loads a json sidecar with inheritance. Much more straightforward with the current fileTree object compared to old validator way. The call to load the sidecar is being done right before the call to applyRules, this is not the right place for it to happen. Its async but we maybe able to do it closer to context construction?

We currently have functions to evaluate selectors and checks with respect to a context. This add functions to interpret fields and columns entries. These should help with validating sidecars etc. I'm not in love with my implementation of some of these and am happy to throw them out for anything else.

In the schema we don't really have names for all the different types of rules and what all shapes they can take.

todo:

  • [x] Use issue codes and reason text directly from schema rules if they are present.
  • [x] Come up with a reasonable way to generate issue codes for when the rule itself doesn't have ~~a rule~~ an issue.
  • [ ] Fix typing, implemented a stop gap GenericSchema and GenericRule, and still had to use some @ts-expect-error decorators.
  • [ ] Add tests
    • [x] For loadSidecar - inheritance in particular
    • [ ] For eval functions
  • [ ] Find a dataset that really makes use of inheritance to play with.

rwblair avatar Jul 11 '22 20:07 rwblair