diff --git a/bids-validator/src/issues/list.ts b/bids-validator/src/issues/list.ts index d4f7bc0c7..03370b4b2 100644 --- a/bids-validator/src/issues/list.ts +++ b/bids-validator/src/issues/list.ts @@ -121,12 +121,12 @@ const hedIssues = { } export const hedOldToNewLookup = { - 104: hedIssues['HED_ERROR'], - 105: hedIssues['HED_WARNING'], - 106: hedIssues['HED_INTERNAL_ERROR'], - 107: hedIssues['HED_INTERNAL_WARNING'], - 108: hedIssues['HED_MISSING_VALUE_IN_SIDECAR'], - 109: hedIssues['HED_VERSION_NOT_DEFINED'] + 104: 'HED_ERROR', + 105: 'HED_WARNING', + 106: 'HED_INTERNAL_ERROR', + 107: 'HED_INTERNAL_WARNING', + 108: 'HED_MISSING_VALUE_IN_SIDECAR', + 109: 'HED_VERSION_NOT_DEFINED' } export const nonSchemaIssues = { ...filenameIssues, ...hedIssues } diff --git a/bids-validator/src/validators/bids.ts b/bids-validator/src/validators/bids.ts index e06187541..67a1dc5bf 100644 --- a/bids-validator/src/validators/bids.ts +++ b/bids-validator/src/validators/bids.ts @@ -88,7 +88,7 @@ export async function validate( await summary.update(context) } for (const check of perDSChecks) { - check(schema, dsContext, issues) + await check(schema, dsContext, issues) } let derivativesSummary: Record = {} diff --git a/bids-validator/src/validators/hed.ts b/bids-validator/src/validators/hed.ts index 4ae8e8002..ff4958b6f 100644 --- a/bids-validator/src/validators/hed.ts +++ b/bids-validator/src/validators/hed.ts @@ -1,4 +1,6 @@ import hedValidator from '../deps/hed-validator/index.js' +import { hedOldToNewLookup } from '../issues/list.ts' +import { logger } from '../utils/logger.ts' const hedArgs = { eventData: [], @@ -80,7 +82,13 @@ export async function hedValidate(schema, dsContext, issues) { await hedValidator.validator .validateBidsDataset(hedDs) .then((hedValidationIssues) => { - console.log(hedValidationIssues) + logger.debug("Issues from hed validator:") + logger.debug(hedValidationIssues) + const newStyle = hedValidationIssues.map(hedIssue => { + issues.addNonSchemaIssue( + hedOldToNewLookup[hedIssue.code], [{...hedIssue.file, evidence: hedIssue.evidence}] + ) + }) }) return Promise.resolve() }