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

feat: Track files referenced by other files to identify orphans #2057

Closed effigies closed 3 months ago

effigies commented 3 months ago

This implements the legacy checks:

The approach is to add a .viewed boolean field on BIDSFile and trip it when either of the inheritance principle walkBack() or the expression language exists() functions finds the file.

Note that apparently we had a lot of false negatives in the legacy validator, and SIDECAR_WITHOUT_DATAFILE is causing failures of examples.

Should wait on #2064, #2066 and https://github.com/bids-standard/bids-examples/pull/461.

Diff specific to this PR: https://github.com/bids-standard/bids-validator/compare/2ecf188...e5aeeca

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 90.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 87.25%. Comparing base (a4e1a09) to head (73c52d1).

Files Patch % Lines
...ds-validator/src/validators/internal/unusedFile.ts 82.85% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2057 +/- ## ========================================== + Coverage 85.69% 87.25% +1.56% ========================================== Files 91 140 +49 Lines 3782 6788 +3006 Branches 1220 1597 +377 ========================================== + Hits 3241 5923 +2682 - Misses 455 775 +320 - Partials 86 90 +4 ```

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