Skip to content

Commit 1a1b5fd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into dev
2 parents 4f101aa + dd0b080 commit 1a1b5fd

17 files changed

+171
-43
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11

2+
<a id='changelog-"2.0.8"'></a>
3+
# "2.0.8" — 2025-08-07
4+
5+
## Added
6+
7+
- Support multi-inheritance for associated files.
8+
This will allow for multiple `electrodes.tsv` files,
9+
distinguished by the `space-` entity. ([#206] [#207])
10+
11+
[#206]: https://github.com/bids-standard/bids-validator/issues/206
12+
[#207]: https://github.com/bids-standard/bids-validator/pull/207
13+
214
<a id='changelog-2.0.7'></a>
315
# 2.0.7 — 2025-06-03
416

build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
import * as esbuild from 'https://deno.land/x/[email protected]/mod.js'
88
import { parse } from 'https://deno.land/[email protected]/flags/mod.ts'
9-
import { denoPlugins } from "jsr:@luca/esbuild-[email protected]"
9+
import { denoPlugin } from "jsr:@deno/esbuild-[email protected]";
1010
import * as path from "https://deno.land/[email protected]/path/mod.ts"
1111
import { getVersion } from './src/version.ts'
1212

@@ -51,7 +51,7 @@ const result = await esbuild.build({
5151
target: ['chrome109', 'firefox109', 'safari16'],
5252
plugins: [
5353
versionPlugin,
54-
...denoPlugins({
54+
denoPlugin({
5555
configPath: path.join(dir, 'deno.json'),
5656
}),
5757
],
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
### Changed
2+
3+
- Upgraded to BIDS schema version 1.0.13.
4+
5+
<!--
6+
### Fixed
7+
8+
- A bullet item for the Fixed category.
9+
10+
-->
11+
<!--
12+
### Deprecated
13+
14+
- A bullet item for the Deprecated category.
15+
16+
-->
17+
<!--
18+
### Removed
19+
20+
- A bullet item for the Removed category.
21+
22+
-->
23+
<!--
24+
### Security
25+
26+
- A bullet item for the Security category.
27+
28+
-->
29+
<!--
30+
### Infrastructure
31+
32+
- A bullet item for the Infrastructure category.
33+
34+
-->
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Added
10+
11+
- A bullet item for the Added category.
12+
13+
-->
14+
### Changed
15+
16+
- Raise error when JSON files are parsed and their root value is anything other than an object
17+
18+
<!--
19+
### Fixed
20+
21+
- A bullet item for the Fixed category.
22+
23+
-->
24+
<!--
25+
### Deprecated
26+
27+
- A bullet item for the Deprecated category.
28+
29+
-->
30+
<!--
31+
### Removed
32+
33+
- A bullet item for the Removed category.
34+
35+
-->
36+
<!--
37+
### Security
38+
39+
- A bullet item for the Security category.
40+
41+
-->
42+
<!--
43+
### Infrastructure
44+
45+
- A bullet item for the Infrastructure category.
46+
47+
-->

changelog.d/20250530_082223_markiewicz_multi_inheritance.md renamed to changelog.d/20250819_113044_markiewicz_display_version.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ For top level release notes, leave all the headers commented out.
77

88
### Added
99

10-
- Support multi-inheritance for associated files.
11-
This will allow for multiple `electrodes.tsv` files,
12-
distinguished by the `space-` entity. ([#206] [#207])
13-
14-
[#206]: https://github.com/bids-standard/bids-validator/issues/206
15-
[#207]: https://github.com/bids-standard/bids-validator/pull/207
10+
- Display version in web app
1611

1712
<!--
1813
### Changed

deno.lock

Lines changed: 39 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/files/inheritance.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import type { BIDSFile, FileTree } from '../types/filetree.ts'
22
import { readEntities } from '../schema/entities.ts'
33

4-
54
type Ret<T> = T extends [string, ...string[]] ? (BIDSFile | BIDSFile[]) : BIDSFile
65

76
/** Find associated files in order of proximity to a source file.

src/files/json.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@ async function readJSONText(file: BIDSFile): Promise<string> {
2222

2323
export async function loadJSON(file: BIDSFile): Promise<Record<string, unknown>> {
2424
const text = await readJSONText(file) // Raise encoding errors
25+
let parsedText
2526
try {
26-
return JSON.parse(text)
27+
parsedText = JSON.parse(text)
2728
} catch (error) {
2829
throw { key: 'JSON_INVALID' } // Raise syntax errors
2930
}
31+
if (Array.isArray(parsedText) || typeof parsedText !== 'object') {
32+
throw {
33+
key: 'JSON_NOT_AN_OBJECT',
34+
evidence: text.substring(0, 10) + (text.length > 10 ? '...' : ''),
35+
}
36+
}
37+
return parsedText
3038
}

src/issues/list.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export const bidsIssues: IssueDefinitionRecord = {
99
severity: 'error',
1010
reason: 'Not a valid JSON file.',
1111
},
12+
JSON_NOT_AN_OBJECT: {
13+
severity: 'error',
14+
reason: 'Parsed JSON file does not contain an object.',
15+
},
1216
MISSING_DATASET_DESCRIPTION: {
1317
severity: 'error',
1418
reason: 'A dataset_description.json file is required in the root of the dataset',

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { consoleFormat, resultToJSONStr } from './utils/output.ts'
1010
import { setupLogging } from './utils/logger.ts'
1111
import type { ValidationResult } from './types/validation-result.ts'
1212
export type { ValidationResult } from './types/validation-result.ts'
13+
export { getVersion } from './version.ts'
1314

1415
/**
1516
* Validation entrypoint intended for command line usage with Deno

0 commit comments

Comments
 (0)