Skip to content

Commit 85e5bf5

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix/deno_2_test_and_build
2 parents 6fe71cc + fb6486e commit 85e5bf5

File tree

8 files changed

+16
-25
lines changed

8 files changed

+16
-25
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,3 @@ updates:
1515
directory: '/'
1616
schedule:
1717
interval: 'monthly'
18-
# - package-ecosystem: 'npm'
19-
# directory: '/'
20-
# schedule:
21-
# interval: 'weekly'
22-
#
23-
# - package-ecosystem: 'npm'
24-
# directory: '/bids-validator-web'
25-
# schedule:
26-
# interval: 'weekly'

.github/workflows/schema_web_deploy.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
# Use Node 18 for legacy build
18-
- uses: actions/setup-node@v4
19-
with:
20-
node-version: 18
21-
- uses: denoland/setup-deno@v2
17+
- uses: denoland/setup-deno@v1
2218
with:
2319
deno-version: v2.x
2420
- run: deno task build
2521
working-directory: ./web
2622
- name: Install NPM deps
2723
run: npm install
28-
working-directory: ./legacy
29-
- name: Build legacy validator website
30-
run: npm run web-export
31-
working-directory: ./legacy
32-
- name: Move legacy validator build into deno website
33-
run: mv legacy/bids-validator-web/out web/dist/legacy
3424
- name: Upload GitHub Pages artifact
3525
uses: actions/upload-pages-artifact@v3
3626
with:

bids-validator/deno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"./main": "./src/main.ts",
77
"./output": "./src/utils/output.ts",
88
"./files": "./src/files/deno.ts",
9-
"./options": "./src/setup/options.ts"
9+
"./options": "./src/setup/options.ts",
10+
"./issues": "./src/issues/datasetIssues.ts"
1011
},
1112
"publish": {
1213
"exclude": [

bids-validator/src/files/deno.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { type BIDSFile, FileTree } from '../types/filetree.ts'
77
import { requestReadPermission } from '../setup/requestPermissions.ts'
88
import { FileIgnoreRules, readBidsIgnore } from './ignore.ts'
99
import { logger } from '../utils/logger.ts'
10+
export { type BIDSFile, FileTree }
1011

1112
/**
1213
* Thrown when a text file is decoded as UTF-8 but contains UTF-16 characters

bids-validator/src/issues/datasetIssues.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { nonSchemaIssues } from './list.ts'
2-
import type { Issue, Severity } from '../types/issues.ts'
2+
import type { Issue, Severity, IssueDefinition, IssueFile } from '../types/issues.ts'
3+
export type { Issue, Severity, IssueDefinition, IssueFile }
34

45
// Code is deprecated, return something unusual but JSON serializable
56
const CODE_DEPRECATED = Number.MIN_SAFE_INTEGER

bids-validator/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { validate } from './validators/bids.ts'
88
import { consoleFormat, resultToJSONStr } from './utils/output.ts'
99
import { setupLogging } from './utils/logger.ts'
1010
import type { ValidationResult } from './types/validation-result.ts'
11+
export type { ValidationResult } from './types/validation-result.ts'
1112

1213
/**
1314
* Validation entrypoint intended for command line usage with Deno

bids-validator/src/setup/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { LevelName } from '@std/log'
33
import { Command, EnumType } from '@cliffy/command'
44
import { getVersion } from '../version.ts'
55
import type { Issue, Severity } from '../types/issues.ts'
6+
import { schema } from '@bids/schema'
67

78
/**
89
* BIDS Validator config file object definition
@@ -31,7 +32,7 @@ export type ValidatorOptions = {
3132
}
3233

3334
const modalityType = new EnumType<string>(
34-
['MRI', 'PET', 'MEG', 'EEG', 'iEEG', 'Microscopy', 'NIRS', 'MRS'],
35+
Object.keys(schema.rules.modalities)
3536
)
3637

3738
/** Extendable Cliffy Command with built in BIDS validator options */

bids-validator/src/validators/bids.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { type BIDSContext, BIDSContextDataset } from '../schema/context.ts'
1818
import type { parseOptions } from '../setup/options.ts'
1919
import { hedValidate } from './hed.ts'
2020
import { citationValidate } from './citation.ts'
21+
import { logger } from '../utils/logger.ts'
2122

2223
/**
2324
* Ordering of checks to apply
@@ -121,8 +122,12 @@ export async function validate(
121122
// Map blacklisted datatypes back to the modality that generated them
122123
for (const modality of options.blacklistModalities) {
123124
const datatypes = modalitiesRule[modality.toLowerCase()]?.datatypes as string[]
124-
for (const datatype of datatypes) {
125-
blacklistedDatatypes.set(datatype, modality)
125+
if (datatypes) {
126+
for (const datatype of datatypes) {
127+
blacklistedDatatypes.set(datatype, modality)
128+
}
129+
} else {
130+
logger.warn(`Attempted to blacklist unknown modality: ${modality}`)
126131
}
127132
}
128133
}

0 commit comments

Comments
 (0)