@@ -9,7 +9,6 @@ const sidecarExtensions = ['.json', '.tsv', '.bvec', '.bval']
99
1010const CHECKS : ContextCheckFunction [ ] = [
1111 missingLabel ,
12- atRoot ,
1312 entityLabelCheck ,
1413 checkRules ,
1514 reconstructionFailure ,
@@ -25,13 +24,6 @@ export async function filenameValidate(
2524 return Promise . resolve ( )
2625}
2726
28- export function isAtRoot ( context : BIDSContext ) {
29- if ( context . file . path . split ( SEPARATOR_PATTERN ) . length !== 2 ) {
30- return false
31- }
32- return true
33- }
34-
3527export async function missingLabel (
3628 schema : GenericSchema ,
3729 context : BIDSContext ,
@@ -57,15 +49,6 @@ export async function missingLabel(
5749 return Promise . resolve ( )
5850}
5951
60- export function atRoot ( schema : GenericSchema , context : BIDSContext ) {
61- /*
62- if (fileIsAtRoot && !sidecarExtensions.includes(context.extension)) {
63- // create issue for data file in root of dataset
64- }
65- */
66- return Promise . resolve ( )
67- }
68-
6952export function lookupEntityLiteral ( name : string , schema : GenericSchema ) {
7053 if (
7154 schema . objects &&
@@ -203,9 +186,8 @@ function entityRuleIssue(
203186 const fileEntities = Object . keys ( context . entities )
204187 const ruleEntities = Object . keys ( rule . entities ) . map ( ( key ) => lookupEntityLiteral ( key , schema ) )
205188
206- // skip required entity checks if file is at root.
207- // No requirements for inherited sidecars at this level.
208- if ( ! isAtRoot ( context ) ) {
189+ // skip required entity checks for 'metadata' per inheritance rules 1 + 2
190+ if ( ! sidecarExtensions . includes ( context . extension ) ) {
209191 const ruleEntitiesRequired = Object . entries ( rule . entities )
210192 . filter ( ( [ _ , v ] ) => v === 'required' )
211193 . map ( ( [ k , _ ] ) => lookupEntityLiteral ( k , schema ) )
0 commit comments