Skip to content

Commit 15069f7

Browse files
committed
Merge branch 'main' of github.com:bids-standard/bids-validator
2 parents e11d016 + 266310f commit 15069f7

File tree

16 files changed

+186
-121
lines changed

16 files changed

+186
-121
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Tue Mar 25 15:43:26 2025 -0400 - [email protected] - chore(fmt): deno fmt [ignore-rev]
2+
51510f5ecd91027f6ab4bfd1d0d287aaf6300e8d
13
# Wed Aug 28 11:37:33 2024 -0400 - [email protected] - chore(fmt): deno fmt [ignore-rev]
24
ff6015b9b2d9b1f215905d71e7dc7a14b8f29f56
35
# Fri Aug 16 17:23:33 2024 -0400 - [email protected] - chore(fmt): deno fmt [ignore-rev]

.github/scripts/scriv_check.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Modified from https://github.com/tarides/changelog-check-action/tree/main
3+
4+
set -uo pipefail
5+
6+
if [ "${NO_CHANGELOG_LABEL}" = "true" ]; then
7+
# 'no changelog' set, so finish successfully
8+
exit 0
9+
else
10+
# a changelog check is required
11+
# fail if the diff is empty
12+
if git diff --exit-code "origin/${BASE_REF}" -- "changelog.d/"; then
13+
cat <<END >&2
14+
User-visible changes should come with an entry in the changelog.
15+
Create a changelog blurb with "uvx scriv create --edit".
16+
If no changelog entry is needed, then set the "no changelog" label.
17+
END
18+
exit 1
19+
fi
20+
fi

.github/workflows/deno_tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,16 @@ jobs:
7272
run: echo 'PERMS=--allow-read --allow-write --allow-env --allow-run --deny-net' >> $GITHUB_ENV
7373
if: ${{ ! matrix.allow-net }}
7474
- name: Disable example that requires network access
75-
run: touch tests/data/bids-examples/xeeg_hed_score/.SKIP_VALIDATION
75+
run: |
76+
for DS in eeg_ds003645s_hed_library xeeg_hed_score; do
77+
touch tests/data/bids-examples/${DS}/.SKIP_VALIDATION
78+
done
7679
if: ${{ ! matrix.allow-net }}
7780
- name: Disable unreleased examples
78-
run: touch tests/data/bids-examples/dwi_deriv/.SKIP_VALIDATION
81+
run: |
82+
for DS in dwi_deriv pheno004; do
83+
touch tests/data/bids-examples/${DS}/.SKIP_VALIDATION
84+
done
7985
if: github.ref_name != 'dev' && github.base_ref != 'dev'
8086
- run: deno test --node-modules-dir=auto $PERMS --coverage=cov/ src/
8187
- name: Collect coverage

.github/workflows/validation.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,15 @@ jobs:
2222
python-version: 3
2323
- name: Validate CITATION.cff
2424
run: pipx run cffconvert --validate
25+
check_change_log:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
- name: Check for changes in changelog
32+
env:
33+
BASE_REF: ${{ github.event.pull_request.base.ref }}
34+
NO_CHANGELOG_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no changelog') }}
35+
run: .github/scripts/scriv_check.sh
36+
shell: bash
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+
-->
6+
7+
### Added
8+
9+
- Validate directory names names according to `schema.rules.directories` entries.
10+
Use rules to identify "opaque" directories whose contents are unspecified by BIDS.
11+
12+
<!--
13+
### Changed
14+
15+
- A bullet item for the Changed category.
16+
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+
-->

deno.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
},
2929
"imports": {
3030
"@ajv": "npm:[email protected]",
31-
"@bids/schema": "jsr:@bids/[email protected].3",
31+
"@bids/schema": "jsr:@bids/[email protected].4",
3232
"@cliffy/command": "jsr:@effigies/[email protected]",
3333
"@cliffy/table": "jsr:@effigies/[email protected]",
34-
"@hed/validator": "npm:hed-validator@3.15.5",
34+
"@hed/validator": "npm:hed-validator@4.0.1",
3535
"@ignore": "npm:[email protected]",
3636
"@libs/xml": "jsr:@libs/[email protected]",
3737
"@mango/nifti": "npm:@bids/[email protected]",
38-
"@std/assert": "jsr:@std/[email protected].11",
39-
"@std/fmt": "jsr:@std/[email protected].5",
40-
"@std/fs": "jsr:@std/[email protected].13",
38+
"@std/assert": "jsr:@std/[email protected].12",
39+
"@std/fmt": "jsr:@std/[email protected].6",
40+
"@std/fs": "jsr:@std/[email protected].15",
4141
"@std/io": "jsr:@std/[email protected]",
4242
"@std/log": "jsr:@std/[email protected]",
4343
"@std/path": "jsr:@std/[email protected]",

deno.lock

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

src/issues/list.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ export const bidsIssues: IssueDefinitionRecord = {
179179
severity: 'error',
180180
reason: 'We were unable to read this file.',
181181
},
182-
}
183-
184-
const hedIssues: IssueDefinitionRecord = {
185182
HED_ERROR: {
186183
severity: 'error',
187184
reason: 'The validation on this HED string returned an error.',
@@ -190,33 +187,6 @@ const hedIssues: IssueDefinitionRecord = {
190187
severity: 'warning',
191188
reason: 'The validation on this HED string returned a warning.',
192189
},
193-
HED_INTERNAL_ERROR: {
194-
severity: 'error',
195-
reason: 'An internal error occurred during HED validation.',
196-
},
197-
HED_INTERNAL_WARNING: {
198-
severity: 'warning',
199-
reason: 'An internal warning occurred during HED validation.',
200-
},
201-
HED_MISSING_VALUE_IN_SIDECAR: {
202-
severity: 'warning',
203-
reason:
204-
'The json sidecar does not contain this column value as a possible key to a HED string.',
205-
},
206-
HED_VERSION_NOT_DEFINED: {
207-
severity: 'warning',
208-
reason:
209-
"You should define 'HEDVersion' for this file. If you don't provide this information, the HED validation will use the latest version available.",
210-
},
211-
}
212-
213-
export const hedOldToNewLookup: Record<number, Partial<keyof IssueDefinitionRecord>> = {
214-
104: 'HED_ERROR',
215-
105: 'HED_WARNING',
216-
106: 'HED_INTERNAL_ERROR',
217-
107: 'HED_INTERNAL_WARNING',
218-
108: 'HED_MISSING_VALUE_IN_SIDECAR',
219-
109: 'HED_VERSION_NOT_DEFINED',
220190
}
221191

222-
export const nonSchemaIssues = { ...bidsIssues, ...hedIssues }
192+
export const nonSchemaIssues = { ...bidsIssues }

src/schema/context.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { buildAssociations } from './associations.ts'
2525
import type { ValidatorOptions } from '../setup/options.ts'
2626
import { logger } from '../utils/logger.ts'
2727

28-
2928
export class BIDSContextDataset implements Dataset {
3029
#dataset_description: Record<string, unknown> = {}
3130
tree: FileTree
@@ -100,7 +99,6 @@ export class BIDSContextDataset implements Dataset {
10099
isOpaqueDirectory(file: FileTree): boolean {
101100
return this.opaqueDirectories.has(file.path)
102101
}
103-
104102
}
105103

106104
class BIDSContextDatasetSubjects implements Subjects {

src/schema/fixtures.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const subjectJson = JSON.stringify({ subOverwrite: 'subject', subValue: 'subject
1111
const rootJson = JSON.stringify({ rootOverwrite: 'root', rootValue: 'root' })
1212

1313
function readBytes(json: string) {
14-
return (size: number) => Promise.resolve(new TextEncoder().encode(json) as Uint8Array<ArrayBuffer>)
14+
return (size: number) =>
15+
Promise.resolve(new TextEncoder().encode(json) as Uint8Array<ArrayBuffer>)
1516
}
1617

1718
export const rootFileTree = pathsToTree([

0 commit comments

Comments
 (0)