bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/legacy-validator/
MIT License
186 stars 111 forks source link

rf(context): Move file tree, schema, and issues into context.dataset #2066

Closed effigies closed 3 months ago

effigies commented 3 months ago

Dataset issues sensibly accumulate on the long-lived dataset object, instead of the ephemeral context object. dataset.tree is defined by the schema, and also makes sense there.

I think walk.ts demonstrates this well. The dataset context provides the files to be iterated over, and a new context can be generated with just the current file and the dataset context.

There's still room to pre-allocate a context.subject object and pass that through, but this is enough of a change for one PR, IMO.

This will help focus #2057 on the specific changes needed for those issues.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 79.41176% with 21 lines in your changes missing coverage. Please review.

Project coverage is 87.14%. Comparing base (12f40bb) to head (e710edd). Report is 1 commits behind head on master.

Files Patch % Lines
bids-validator/src/schema/applyRules.ts 40.00% 9 Missing :warning:
bids-validator/src/schema/context.ts 86.20% 8 Missing :warning:
bids-validator/src/validators/filenameValidate.ts 72.72% 3 Missing :warning:
bids-validator/src/validators/bids.ts 87.50% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2066 +/- ## ========================================== + Coverage 85.69% 87.14% +1.44% ========================================== Files 91 139 +48 Lines 3782 6689 +2907 Branches 1220 1579 +359 ========================================== + Hits 3241 5829 +2588 - Misses 455 770 +315 - Partials 86 90 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.