File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,20 @@ export const bidsIssues: IssueDefinitionRecord = {
162162 severity : 'error' ,
163163 reason : 'A json sidecar file was found without a corresponding data file' ,
164164 } ,
165+ BLACKLISTED_MODALITY : {
166+ severity : 'error' ,
167+ reason : 'The modality in this file is blacklisted through validator configuration.' ,
168+ } ,
169+ CITATION_CFF_VALIDATION_ERROR : {
170+ severity : 'error' ,
171+ reason :
172+ "The file does not pass validation using the citation.cff standard's schema." +
173+ 'https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md'
174+ } ,
175+ FILE_READ : {
176+ severity : 'error' ,
177+ reason : 'We were unable to read this file.'
178+ }
165179}
166180
167181const hedIssues : IssueDefinitionRecord = {
@@ -191,10 +205,6 @@ const hedIssues: IssueDefinitionRecord = {
191205 reason :
192206 "You should define 'HEDVersion' for this file. If you don't provide this information, the HED validation will use the latest version available." ,
193207 } ,
194- BLACKLISTED_MODALITY : {
195- severity : 'error' ,
196- reason : 'The modality in this file is blacklisted through validator configuration.' ,
197- } ,
198208}
199209
200210export const hedOldToNewLookup : Record < number , Partial < keyof IssueDefinitionRecord > > = {
Original file line number Diff line number Diff line change @@ -20,6 +20,6 @@ Deno.test('citation validation', async (t) => {
2020 const file = new BIDSFileDeno ( 'tests/data/citation' , 'bad.cff' )
2121 tree . files [ 0 ] . text = ( ) => file . text ( )
2222 await citationValidate ( { } as GenericSchema , dsContext )
23- assert ( dsContext . issues . size === 1 )
23+ assert ( dsContext . issues . get ( { code : 'CITATION_CFF_VALIDATION_ERROR' } ) . length === 1 )
2424 } )
2525} )
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export async function citationValidate(
1818 try {
1919 citation = parse ( await citationFile . text ( ) )
2020 } catch ( error ) {
21- throw error
21+ dsContext . issues . add ( {
22+ code : 'FILE_READ' ,
23+ issueMessage : `Error from attempted read of file:\n${ error } ` ,
24+ location : citationFilename ,
25+ } )
2226 return
2327 }
2428 const validate = compile ( citationSchema )
You can’t perform that action at this time.
0 commit comments