Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix/deno_2_test_and…
Browse files Browse the repository at this point in the history
…_build
  • Loading branch information
rwblair committed Oct 31, 2024
2 parents 6fe71cc + fb6486e commit 85e5bf5
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 25 deletions.
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
12 changes: 1 addition & 11 deletions .github/workflows/schema_web_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion bids-validator/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
1 change: 1 addition & 0 deletions bids-validator/src/files/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion bids-validator/src/issues/datasetIssues.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions bids-validator/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion bids-validator/src/setup/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -31,7 +32,7 @@ export type ValidatorOptions = {
}

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

/** Extendable Cliffy Command with built in BIDS validator options */
Expand Down
9 changes: 7 additions & 2 deletions bids-validator/src/validators/bids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}`)
}
}
}
Expand Down

0 comments on commit 85e5bf5

Please sign in to comment.