Skip to content

Commit 10877ad

Browse files
committed
feat: Pass custom config to validator
1 parent 1c1e0d3 commit 10877ad

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/openneuro-app/src/scripts/workers/schema.worker.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
import { fileListToTree, validate } from "../utils/schema-validator.js"
33
import type { BIDSValidatorIssues } from "./worker-interface"
44

5+
const config = {
6+
error: [
7+
{code: 'NO_AUTHORS'},
8+
{code: 'SUBJECT_FOLDERS'}, // bids-standard/bids-specification#1928 downgrades to warning
9+
{code: 'EMPTY_DATASET_NAME'},
10+
]
11+
}
12+
13+
const options = {
14+
json: true,
15+
/* Enable after https://github.com/bids-standard/bids-validator/pull/2176 is released */
16+
// blacklistModalities: ["micr"],
17+
}
18+
519
export async function runValidator(
620
files,
721
options,
@@ -14,7 +28,7 @@ export async function runValidator(
1428
} as BIDSValidatorIssues
1529
try {
1630
const tree = await fileListToTree(files)
17-
const result = await validate(tree, { json: true })
31+
const result = await validate(tree, options, config)
1832
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
1933
const issues = Array.from(result.issues, ([key, value]) => value)
2034
output.issues.warnings = issues.filter(

0 commit comments

Comments
 (0)