Skip to content

Commit

Permalink
filenameValidate.ts handles multiple rule matches properly, no need t…
Browse files Browse the repository at this point in the history
…o truncate rule matches unnecessarily in filenameIdentify.ts

fixes longstanding ds000248 validation error.
  • Loading branch information
rwblair committed Apr 19, 2024
1 parent dc61d0f commit ba4c59d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bids-validator/src/validators/filenameIdentify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,10 @@ export function hasMatch(schema, context) {
const entExtMatch = context.filenameRules.filter((rulePath) => {
return entitiesExtensionsInRule(schema, context, rulePath)
})
if (entExtMatch.length > 0) {
context.filenameRules = [entExtMatch[0]]
if (entExtMatch.length == 1) {
context.filenameRules = entExtMatch

Check warning on line 133 in bids-validator/src/validators/filenameIdentify.ts

View check run for this annotation

Codecov / codecov/patch

bids-validator/src/validators/filenameIdentify.ts#L133

Added line #L133 was not covered by tests
}
}
/* If we end up with multiple rules we should generate an error? */
if (context.filenameRules.length > 1) {
}

return Promise.resolve()
}
Expand Down

0 comments on commit ba4c59d

Please sign in to comment.