bids-validator-deno 2.0.8__tar.gz → 2.0.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bids-validator-deno might be problematic. Click here for more details.
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/PKG-INFO +1 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/deno.json +2 -2
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/pyproject.toml +1 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/inheritance.ts +0 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/json.ts +9 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/issues/list.ts +8 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/main.ts +1 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/applyRules.ts +3 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/context.ts +2 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/tables.ts +1 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/setup/options.test.ts +1 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/setup/options.ts +11 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/summary/collectSubjectMetadata.ts +2 -2
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/regression.test.ts +2 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/validation-result.ts +1 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/bids.test.ts +5 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/bids.ts +12 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/hed.ts +7 -1
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/LICENSE +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/README.md +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/pdm_build.py +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/.git-meta.json +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/bids-validator.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/browser.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/browser.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/deno.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/deno.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/dwi.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/dwi.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/filetree.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/filetree.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/gzip.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/gzip.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/ignore.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/ignore.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/inheritance.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/json.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/nifti.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/nifti.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/streams.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/streams.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/tiff.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/tiff.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/tsv.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/files/tsv.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/issues/datasetIssues.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/issues/datasetIssues.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/issues/list.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/applyRules.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/associations.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/context.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/entities.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/entities.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/expressionLanguage.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/expressionLanguage.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/fixtures.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/modalities.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/tables.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/walk.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/walk.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/setup/loadSchema.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/setup/loadSchema.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/setup/requestPermissions.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/summary/summary.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/summary/summary.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/README.md +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/bom-utf16.tsv +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/bom-utf8.json +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/generate-filenames.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/bids_examples.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/common.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/derivatives.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/empty_files.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/hed-integration.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_dataset.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_filenames.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_headers.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/nullReadBytes.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/schema-expression-language.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/simple-dataset.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/utils.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/check.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/columns.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/columns.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/filetree.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/issues.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/types/schema.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/errors.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/logger.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/logger.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/memoize.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/objectPathHandler.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/utils/output.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/citation.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/citation.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameIdentify.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameIdentify.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameValidate.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameValidate.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/internal/emptyFile.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/internal/unusedFile.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/json.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/validateFiles.test.ts +0 -0
- {bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/version.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bids/validator",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./src/bids-validator.ts",
|
|
6
6
|
"./main": "./src/main.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"imports": {
|
|
30
30
|
"@ajv": "npm:ajv@8.17.1",
|
|
31
|
-
"@bids/schema": "jsr:@bids/schema
|
|
31
|
+
"@bids/schema": "jsr:@bids/schema@~1.0.14",
|
|
32
32
|
"@cliffy/command": "jsr:@effigies/cliffy-command@1.0.0-dev.8",
|
|
33
33
|
"@cliffy/table": "jsr:@effigies/cliffy-table@1.0.0-dev.5",
|
|
34
34
|
"@hed/validator": "npm:hed-validator@4.0.1",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BIDSFile, FileTree } from '../types/filetree.ts'
|
|
2
2
|
import { readEntities } from '../schema/entities.ts'
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
type Ret<T> = T extends [string, ...string[]] ? (BIDSFile | BIDSFile[]) : BIDSFile
|
|
6
5
|
|
|
7
6
|
/** Find associated files in order of proximity to a source file.
|
|
@@ -22,9 +22,17 @@ async function readJSONText(file: BIDSFile): Promise<string> {
|
|
|
22
22
|
|
|
23
23
|
export async function loadJSON(file: BIDSFile): Promise<Record<string, unknown>> {
|
|
24
24
|
const text = await readJSONText(file) // Raise encoding errors
|
|
25
|
+
let parsedText
|
|
25
26
|
try {
|
|
26
|
-
|
|
27
|
+
parsedText = JSON.parse(text)
|
|
27
28
|
} catch (error) {
|
|
28
29
|
throw { key: 'JSON_INVALID' } // Raise syntax errors
|
|
29
30
|
}
|
|
31
|
+
if (Array.isArray(parsedText) || typeof parsedText !== 'object') {
|
|
32
|
+
throw {
|
|
33
|
+
key: 'JSON_NOT_AN_OBJECT',
|
|
34
|
+
evidence: text.substring(0, 10) + (text.length > 10 ? '...' : ''),
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return parsedText
|
|
30
38
|
}
|
|
@@ -9,6 +9,10 @@ export const bidsIssues: IssueDefinitionRecord = {
|
|
|
9
9
|
severity: 'error',
|
|
10
10
|
reason: 'Not a valid JSON file.',
|
|
11
11
|
},
|
|
12
|
+
JSON_NOT_AN_OBJECT: {
|
|
13
|
+
severity: 'error',
|
|
14
|
+
reason: 'Parsed JSON file does not contain an object.',
|
|
15
|
+
},
|
|
12
16
|
MISSING_DATASET_DESCRIPTION: {
|
|
13
17
|
severity: 'error',
|
|
14
18
|
reason: 'A dataset_description.json file is required in the root of the dataset',
|
|
@@ -166,6 +170,10 @@ export const bidsIssues: IssueDefinitionRecord = {
|
|
|
166
170
|
severity: 'error',
|
|
167
171
|
reason: 'A json sidecar file was found without a corresponding data file',
|
|
168
172
|
},
|
|
173
|
+
UNSUPPORTED_DATASET_TYPE: {
|
|
174
|
+
severity: 'error',
|
|
175
|
+
reason: 'This DatasetType is not supported by the application.',
|
|
176
|
+
},
|
|
169
177
|
BLACKLISTED_MODALITY: {
|
|
170
178
|
severity: 'error',
|
|
171
179
|
reason: 'The modality in this file is blacklisted through validator configuration.',
|
|
@@ -10,6 +10,7 @@ import { consoleFormat, resultToJSONStr } from './utils/output.ts'
|
|
|
10
10
|
import { setupLogging } from './utils/logger.ts'
|
|
11
11
|
import type { ValidationResult } from './types/validation-result.ts'
|
|
12
12
|
export type { ValidationResult } from './types/validation-result.ts'
|
|
13
|
+
export { getVersion } from './version.ts'
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Validation entrypoint intended for command line usage with Deno
|
|
@@ -183,7 +183,9 @@ function evalJsonCheck(
|
|
|
183
183
|
// Count on other JSON rules to use selectors to match the correct files
|
|
184
184
|
// Text files at the root do not have sidecars. We might want a cleaner
|
|
185
185
|
// or more schematic way to identify them in the future.
|
|
186
|
-
if (sidecarRule && (['.json', '', '.md', '.txt', '.rst', '.cff'].includes(context.extension)))
|
|
186
|
+
if (sidecarRule && (['.json', '', '.md', '.txt', '.rst', '.cff'].includes(context.extension))) {
|
|
187
|
+
return
|
|
188
|
+
}
|
|
187
189
|
|
|
188
190
|
const json: Record<string, any> = sidecarRule ? context.sidecar : context.json
|
|
189
191
|
for (const [key, requirement] of Object.entries(rule.fields)) {
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
Subjects,
|
|
10
10
|
Tiff,
|
|
11
11
|
} from '@bids/schema/context'
|
|
12
|
+
import type { Schemas as HedSchemas } from '@hed/validator'
|
|
12
13
|
import type { Schema } from '../types/schema.ts'
|
|
13
14
|
import type { BIDSFile } from '../types/filetree.ts'
|
|
14
15
|
import { FileTree } from '../types/filetree.ts'
|
|
@@ -41,7 +42,7 @@ export class BIDSContextDataset implements Dataset {
|
|
|
41
42
|
opaqueDirectories: Set<string>
|
|
42
43
|
|
|
43
44
|
// Opaque object for HED validator
|
|
44
|
-
hedSchemas:
|
|
45
|
+
hedSchemas: HedSchemas | undefined | null = undefined
|
|
45
46
|
|
|
46
47
|
constructor(
|
|
47
48
|
args: Partial<BIDSContextDataset>,
|
|
@@ -239,7 +239,7 @@ export function evalAdditionalColumns(
|
|
|
239
239
|
if (context.extension !== '.tsv') return
|
|
240
240
|
const headers = Object.keys(context?.columns)
|
|
241
241
|
if (rule.columns) {
|
|
242
|
-
if (!rule.additional_columns || rule.additional_columns === 'n/a'
|
|
242
|
+
if (!rule.additional_columns || rule.additional_columns === 'n/a') {
|
|
243
243
|
// Old schemas might be missing the field, so be permissive.
|
|
244
244
|
// New schemas indicate it is not applicable with 'n/a'.
|
|
245
245
|
return
|
|
@@ -28,11 +28,16 @@ export type ValidatorOptions = {
|
|
|
28
28
|
color?: boolean
|
|
29
29
|
recursive?: boolean
|
|
30
30
|
outfile?: string
|
|
31
|
+
datasetTypes: string[]
|
|
31
32
|
blacklistModalities: string[]
|
|
32
33
|
prune?: boolean
|
|
33
34
|
maxRows?: number
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
const datasetType = new EnumType<string>(
|
|
38
|
+
schema.objects.metadata.DatasetType.enum as string[],
|
|
39
|
+
)
|
|
40
|
+
|
|
36
41
|
const modalityType = new EnumType<string>(
|
|
37
42
|
Object.keys(schema.rules.modalities),
|
|
38
43
|
)
|
|
@@ -69,6 +74,12 @@ export const validateCommand: Command<void, void, any, string[], void> = new Com
|
|
|
69
74
|
'--filenameMode',
|
|
70
75
|
'Enable filename checks for newline separated filenames read from stdin',
|
|
71
76
|
)
|
|
77
|
+
.type('datasetType', datasetType)
|
|
78
|
+
.option(
|
|
79
|
+
'--datasetTypes <...datasetTypes:datasetType>',
|
|
80
|
+
'Permitted dataset types to validate against (default: all)',
|
|
81
|
+
{ default: [] as string[] },
|
|
82
|
+
)
|
|
72
83
|
.type('modality', modalityType)
|
|
73
84
|
.option(
|
|
74
85
|
'--blacklistModalities <...modalities:modality>',
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/summary/collectSubjectMetadata.ts
RENAMED
|
@@ -54,8 +54,8 @@ export const collectSubjectMetadata = (
|
|
|
54
54
|
)
|
|
55
55
|
// make age an integer
|
|
56
56
|
if (ageKey) {
|
|
57
|
-
if(data[ageKey.index] ===
|
|
58
|
-
data[ageKey.index] =
|
|
57
|
+
if (data[ageKey.index] === '89+') {
|
|
58
|
+
data[ageKey.index] = '89+'
|
|
59
59
|
} else {
|
|
60
60
|
// @ts-expect-error
|
|
61
61
|
data[ageKey.index] = parseFloat(data[ageKey.index])
|
|
@@ -24,6 +24,7 @@ Deno.test('Regression tests', async (t) => {
|
|
|
24
24
|
debug: 'ERROR',
|
|
25
25
|
ignoreNiftiHeaders: true,
|
|
26
26
|
blacklistModalities: [],
|
|
27
|
+
datasetTypes: [],
|
|
27
28
|
})
|
|
28
29
|
assert(result.issues.get({ code: 'NOT_INCLUDED' }).length == 1)
|
|
29
30
|
assert(result.issues.get({ code: 'SCANS_FILENAME_NOT_MATCH_DATASET' }).length == 0)
|
|
@@ -37,6 +38,7 @@ Deno.test('Regression tests', async (t) => {
|
|
|
37
38
|
debug: 'ERROR',
|
|
38
39
|
ignoreNiftiHeaders: true,
|
|
39
40
|
blacklistModalities: [],
|
|
41
|
+
datasetTypes: [],
|
|
40
42
|
})
|
|
41
43
|
assert(result.issues.get({ code: 'NOT_INCLUDED' }).length == 0)
|
|
42
44
|
assert(result.issues.get({ code: 'SCANS_FILENAME_NOT_MATCH_DATASET' }).length == 0)
|
|
@@ -14,6 +14,7 @@ Deno.test('Smoke tests of main validation function', async (t) => {
|
|
|
14
14
|
debug: 'INFO',
|
|
15
15
|
ignoreNiftiHeaders: true,
|
|
16
16
|
blacklistModalities: [],
|
|
17
|
+
datasetTypes: [],
|
|
17
18
|
})
|
|
18
19
|
assert(result.issues.get({ code: 'BLACKLISTED_MODALITY' }).length === 0)
|
|
19
20
|
|
|
@@ -22,6 +23,7 @@ Deno.test('Smoke tests of main validation function', async (t) => {
|
|
|
22
23
|
debug: 'INFO',
|
|
23
24
|
ignoreNiftiHeaders: true,
|
|
24
25
|
blacklistModalities: ['MRI'],
|
|
26
|
+
datasetTypes: [],
|
|
25
27
|
})
|
|
26
28
|
assert(result.issues.get({ code: 'BLACKLISTED_MODALITY' }).length === 1)
|
|
27
29
|
|
|
@@ -30,6 +32,7 @@ Deno.test('Smoke tests of main validation function', async (t) => {
|
|
|
30
32
|
debug: 'INFO',
|
|
31
33
|
ignoreNiftiHeaders: true,
|
|
32
34
|
blacklistModalities: ['MEG'],
|
|
35
|
+
datasetTypes: [],
|
|
33
36
|
})
|
|
34
37
|
assert(result.issues.get({ code: 'BLACKLISTED_MODALITY' }).length === 0)
|
|
35
38
|
|
|
@@ -38,6 +41,7 @@ Deno.test('Smoke tests of main validation function', async (t) => {
|
|
|
38
41
|
debug: 'INFO',
|
|
39
42
|
ignoreNiftiHeaders: true,
|
|
40
43
|
blacklistModalities: ['MEG', 'MRI'],
|
|
44
|
+
datasetTypes: [],
|
|
41
45
|
})
|
|
42
46
|
assert(result.issues.get({ code: 'BLACKLISTED_MODALITY' }).length === 1)
|
|
43
47
|
})
|
|
@@ -48,6 +52,7 @@ Deno.test('Smoke tests of main validation function', async (t) => {
|
|
|
48
52
|
datasetPath: '/dataset',
|
|
49
53
|
debug: 'INFO',
|
|
50
54
|
blacklistModalities: [],
|
|
55
|
+
datasetTypes: [],
|
|
51
56
|
},
|
|
52
57
|
{
|
|
53
58
|
ignore: [{ location: '/dataset_description.json' }],
|
|
@@ -72,6 +72,18 @@ export async function validate(
|
|
|
72
72
|
})
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// Empty list defaults to allow all
|
|
76
|
+
if (options.datasetTypes.length) {
|
|
77
|
+
const datasetType = (dsContext.dataset_description.DatasetType ?? 'raw') as string
|
|
78
|
+
if (!options.datasetTypes.includes(datasetType)) {
|
|
79
|
+
dsContext.issues.add({
|
|
80
|
+
code: 'UNSUPPORTED_DATASET_TYPE',
|
|
81
|
+
location: '/dataset_description.json',
|
|
82
|
+
issueMessage: `"DatasetType": "${datasetType}"`,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
const bidsDerivatives: FileTree[] = []
|
|
76
88
|
const nonstdDerivatives: FileTree[] = []
|
|
77
89
|
fileTree.directories = fileTree.directories.filter((dir) => {
|
|
@@ -30,8 +30,14 @@ async function setHedSchemas(dataset: BIDSContextDataset): Promise<HedIssue[]> {
|
|
|
30
30
|
datasetDescriptionData,
|
|
31
31
|
)
|
|
32
32
|
return [] as HedIssue[]
|
|
33
|
-
} catch (
|
|
33
|
+
} catch (error) {
|
|
34
34
|
dataset.hedSchemas = null
|
|
35
|
+
let issueError: Error
|
|
36
|
+
if (error instanceof Error) {
|
|
37
|
+
issueError = error
|
|
38
|
+
} else {
|
|
39
|
+
issueError = new Error('unknown error')
|
|
40
|
+
}
|
|
35
41
|
return hedValidator.BidsHedIssue.fromHedIssues(
|
|
36
42
|
issueError,
|
|
37
43
|
datasetDescriptionData.file,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/schema/expressionLanguage.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/bids_examples.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/hed-integration.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_dataset.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_filenames.test.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/local/valid_headers.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/tests/schema-expression-language.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameIdentify.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/filenameValidate.test.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/internal/emptyFile.ts
RENAMED
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/internal/unusedFile.ts
RENAMED
|
File without changes
|
|
File without changes
|
{bids_validator_deno-2.0.8 → bids_validator_deno-2.0.9}/src/validators/validateFiles.test.ts
RENAMED
|
File without changes
|
|
File without changes
|