diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 028855ae..e3ab0cc4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,12 +15,3 @@ updates: directory: '/' schedule: interval: 'monthly' -# - package-ecosystem: 'npm' -# directory: '/' -# schedule: -# interval: 'weekly' -# -# - package-ecosystem: 'npm' -# directory: '/bids-validator-web' -# schedule: -# interval: 'weekly' diff --git a/.github/workflows/schema_web_deploy.yml b/.github/workflows/schema_web_deploy.yml index f57e345d..8343e752 100644 --- a/.github/workflows/schema_web_deploy.yml +++ b/.github/workflows/schema_web_deploy.yml @@ -14,23 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # Use Node 18 for legacy build - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: denoland/setup-deno@v2 + - uses: denoland/setup-deno@v1 with: deno-version: v2.x - run: deno task build working-directory: ./web - name: Install NPM deps run: npm install - working-directory: ./legacy - - name: Build legacy validator website - run: npm run web-export - working-directory: ./legacy - - name: Move legacy validator build into deno website - run: mv legacy/bids-validator-web/out web/dist/legacy - name: Upload GitHub Pages artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/bids-validator/deno.json b/bids-validator/deno.json index 733fa3b4..cac28390 100644 --- a/bids-validator/deno.json +++ b/bids-validator/deno.json @@ -6,7 +6,8 @@ "./main": "./src/main.ts", "./output": "./src/utils/output.ts", "./files": "./src/files/deno.ts", - "./options": "./src/setup/options.ts" + "./options": "./src/setup/options.ts", + "./issues": "./src/issues/datasetIssues.ts" }, "publish": { "exclude": [ diff --git a/bids-validator/src/files/deno.ts b/bids-validator/src/files/deno.ts index c58173b7..b6fe4b13 100644 --- a/bids-validator/src/files/deno.ts +++ b/bids-validator/src/files/deno.ts @@ -7,6 +7,7 @@ import { type BIDSFile, FileTree } from '../types/filetree.ts' import { requestReadPermission } from '../setup/requestPermissions.ts' import { FileIgnoreRules, readBidsIgnore } from './ignore.ts' import { logger } from '../utils/logger.ts' +export { type BIDSFile, FileTree } /** * Thrown when a text file is decoded as UTF-8 but contains UTF-16 characters diff --git a/bids-validator/src/issues/datasetIssues.ts b/bids-validator/src/issues/datasetIssues.ts index 94d4b3ea..18ecbbc2 100644 --- a/bids-validator/src/issues/datasetIssues.ts +++ b/bids-validator/src/issues/datasetIssues.ts @@ -1,5 +1,6 @@ import { nonSchemaIssues } from './list.ts' -import type { Issue, Severity } from '../types/issues.ts' +import type { Issue, Severity, IssueDefinition, IssueFile } from '../types/issues.ts' +export type { Issue, Severity, IssueDefinition, IssueFile } // Code is deprecated, return something unusual but JSON serializable const CODE_DEPRECATED = Number.MIN_SAFE_INTEGER diff --git a/bids-validator/src/main.ts b/bids-validator/src/main.ts index adb9f0aa..eb9c835f 100644 --- a/bids-validator/src/main.ts +++ b/bids-validator/src/main.ts @@ -8,6 +8,7 @@ import { validate } from './validators/bids.ts' import { consoleFormat, resultToJSONStr } from './utils/output.ts' import { setupLogging } from './utils/logger.ts' import type { ValidationResult } from './types/validation-result.ts' +export type { ValidationResult } from './types/validation-result.ts' /** * Validation entrypoint intended for command line usage with Deno diff --git a/bids-validator/src/setup/options.ts b/bids-validator/src/setup/options.ts index 34fb0394..76aa10f1 100644 --- a/bids-validator/src/setup/options.ts +++ b/bids-validator/src/setup/options.ts @@ -3,6 +3,7 @@ import type { LevelName } from '@std/log' import { Command, EnumType } from '@cliffy/command' import { getVersion } from '../version.ts' import type { Issue, Severity } from '../types/issues.ts' +import { schema } from '@bids/schema' /** * BIDS Validator config file object definition @@ -31,7 +32,7 @@ export type ValidatorOptions = { } const modalityType = new EnumType( - ['MRI', 'PET', 'MEG', 'EEG', 'iEEG', 'Microscopy', 'NIRS', 'MRS'], + Object.keys(schema.rules.modalities) ) /** Extendable Cliffy Command with built in BIDS validator options */ diff --git a/bids-validator/src/validators/bids.ts b/bids-validator/src/validators/bids.ts index 4f5b8cc2..c51b9485 100644 --- a/bids-validator/src/validators/bids.ts +++ b/bids-validator/src/validators/bids.ts @@ -18,6 +18,7 @@ import { type BIDSContext, BIDSContextDataset } from '../schema/context.ts' import type { parseOptions } from '../setup/options.ts' import { hedValidate } from './hed.ts' import { citationValidate } from './citation.ts' +import { logger } from '../utils/logger.ts' /** * Ordering of checks to apply @@ -121,8 +122,12 @@ export async function validate( // Map blacklisted datatypes back to the modality that generated them for (const modality of options.blacklistModalities) { const datatypes = modalitiesRule[modality.toLowerCase()]?.datatypes as string[] - for (const datatype of datatypes) { - blacklistedDatatypes.set(datatype, modality) + if (datatypes) { + for (const datatype of datatypes) { + blacklistedDatatypes.set(datatype, modality) + } + } else { + logger.warn(`Attempted to blacklist unknown modality: ${modality}`) } } }