Skip to content

Commit d4ed1be

Browse files
committed
also skip required entity checks on derivative files
1 parent fda6c76 commit d4ed1be

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

changelog.d/20250605_155304_rosswilsonblair_valid_missing_entities.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ For top level release notes, leave all the headers commented out.
1111
- A bullet item for the Added category.
1212
1313
-->
14+
<!--
1415
### Changed
1516
16-
- Categorically prevent required entites on metadata files to more closely follow inheritance principle.
1717
18-
<!--
18+
-->
1919
### Fixed
2020

21-
- A bullet item for the Fixed category.
21+
- Categorically prevent required entites on metadata files to more closely follow inheritance principle.
22+
- Also skip required entities on all derivative files.
2223

23-
-->
2424
<!--
2525
### Deprecated
2626

src/validators/filenameValidate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { FileTree } from '../types/filetree.ts'
22
import type { GenericSchema } from '../types/schema.ts'
33
import { assertEquals } from '@std/assert'
44
import { BIDSContext } from '../schema/context.ts'
5-
import { type atRoot, type entityLabelCheck, missingLabel } from './filenameValidate.ts'
5+
import { type entityLabelCheck, missingLabel } from './filenameValidate.ts'
66
import type { BIDSFileDeno } from '../files/deno.ts'
77
import { pathToFile } from '../files/filetree.ts'
88
import type { FileIgnoreRules } from '../files/ignore.ts'

src/validators/filenameValidate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ function entityRuleIssue(
187187
const ruleEntities = Object.keys(rule.entities).map((key) => lookupEntityLiteral(key, schema))
188188

189189
// skip required entity checks for 'metadata' per inheritance rules 1 + 2
190-
if (!sidecarExtensions.includes(context.extension)) {
190+
// Also skip for all deriv files.
191+
if (!sidecarExtensions.includes(context.extension) && !path.includes('rules.deriv.')) {
191192
const ruleEntitiesRequired = Object.entries(rule.entities)
192193
.filter(([_, v]) => v === 'required')
193194
.map(([k, _]) => lookupEntityLiteral(k, schema))

0 commit comments

Comments
 (0)