Skip to content

Commit

Permalink
Merge pull request #2121 from nellh/jsr-export-fixes
Browse files Browse the repository at this point in the history
chore: Add docstrings and export missing validateCommand object
  • Loading branch information
rwblair authored Sep 4, 2024
2 parents 3974ad3 + 47572c5 commit 41f39f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions bids-validator/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import { consoleFormat } from './utils/output.ts'
import { setupLogging } from './utils/logger.ts'
import type { ValidationResult } from './types/validation-result.ts'

/**
* Validation entrypoint intended for command line usage with Deno
*
* Parses command line options, runs validation, and formats the result. Call `validate` directly for other environments
*/
export async function main(): Promise<ValidationResult> {
const options = await parseOptions(Deno.args)
colors.setColorEnabled(options.color ?? false)
Expand Down
9 changes: 8 additions & 1 deletion bids-validator/src/setup/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ import { Command, EnumType } from '@cliffy/command'
import { getVersion } from '../version.ts'
import type { Issue, Severity } from '../types/issues.ts'

/**
* BIDS Validator config file object definition
*/
export type Config = {
[key in Severity]?: Partial<Issue>[]
}

/**
* BIDS Validator options object definition
*/
export type ValidatorOptions = {
datasetPath: string
schema?: string
Expand All @@ -27,7 +33,8 @@ const modalityType = new EnumType<string>(
['MRI', 'PET', 'MEG', 'EEG', 'iEEG', 'Microscopy', 'NIRS', 'MRS'],
)

const validateCommand = new Command()
/** Extendable Cliffy Command with built in BIDS validator options */
export const validateCommand = new Command()
.name('bids-validator')
.type('debugLevel', new EnumType(LogLevelNames))
.description(
Expand Down

0 comments on commit 41f39f9

Please sign in to comment.