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

fix(expr): Escape backslashes in checks before interpolating #2042

Closed effigies closed 4 months ago

effigies commented 4 months ago

Was testing https://github.com/bids-standard/bids-specification/pull/1879 and getting odd results. Turns out that our creating a function from strings can collapse escapes. This only appears to affect match() expressions right now.

Will work on a test.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.23%. Comparing base (c06e88d) to head (0dcda48).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2042 +/- ## ========================================== + Coverage 85.75% 87.23% +1.47% ========================================== Files 91 138 +47 Lines 3785 6590 +2805 Branches 1218 1568 +350 ========================================== + Hits 3246 5749 +2503 - Misses 453 751 +298 - Partials 86 90 +4 ```

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

effigies commented 4 months ago

Re-pushed just the test to show that it fails. Now pushing the fix to show that it resolves the problem.

Added some argumentation into the comments of the test to explain to future us why the fix is here, not in the schema.

rwblair commented 4 months ago

Far out, didn't know about String.raw.... Looks good to me.