Skip to content

Commit 40af25c

Browse files
authored
fix(schema): Check paths with initial slashes (#1833)
1 parent b930a64 commit 40af25c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/schema/rules/checks/dataset.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SubjectFolders:
99
There are no subject directories (labeled "sub-*") in the root of this dataset.
1010
level: error
1111
selectors:
12-
- path == 'dataset_description.json'
12+
- path == '/dataset_description.json'
1313
checks:
1414
- length(dataset.subjects.sub_dirs) > 0
1515

@@ -22,7 +22,7 @@ ParticipantIDMismtach:
2222
found in the participants.tsv file.
2323
level: error
2424
selectors:
25-
- path == 'participants.tsv'
25+
- path == '/participants.tsv'
2626
checks:
2727
- sorted(columns.participant_label) == sorted(dataset.subjects.sub_dirs)
2828

@@ -34,7 +34,7 @@ PhenotypeSubjectsMissing:
3434
A phenotype/ .tsv file lists subjects that were not found in the dataset.
3535
level: error
3636
selectors:
37-
- path == 'dataset_description.json'
37+
- path == '/dataset_description.json'
3838
checks:
3939
- sorted(dataset.subjects.phenotype) == sorted(dataset.subjects.sub_dirs)
4040

@@ -47,7 +47,7 @@ SamplesTSVMissing:
4747
See 'Modality agnostic files' section of the BIDS specification.
4848
level: error
4949
selectors:
50-
- path == 'dataset_description.json'
50+
- path == '/dataset_description.json'
5151
- '"micr" in dataset.modalities'
5252
checks:
5353
- "'samples.tsv' in dataset.files"
@@ -60,7 +60,7 @@ UnknownVersion:
6060
The BIDS Schema used for validation may be out of date.
6161
level: warning
6262
selectors:
63-
- path == 'dataset_description.json'
63+
- path == '/dataset_description.json'
6464
checks:
6565
- intersects([json.BIDSVersion], schema.meta.versions)
6666

@@ -72,7 +72,7 @@ SingleSourceAuthors:
7272
'CITATION.cff' file found. The "Authors" field of 'dataset_description.json'
7373
must be removed to avoid inconsistency.
7474
selectors:
75-
- path == 'CITATION.cff'
75+
- path == '/CITATION.cff'
7676
checks:
7777
- '!("Authors" in dataset.dataset_description)'
7878

@@ -85,7 +85,7 @@ SingleSourceCitationFields:
8585
The "HowToAckowledge", "License", and "ReferencesAndLinks" fields of
8686
'dataset_description.json' should be removed to avoid inconsistency.
8787
selectors:
88-
- path == 'CITATION.cff'
88+
- path == '/CITATION.cff'
8989
checks:
9090
- '!("HowToAcknowledge" in dataset.dataset_description)'
9191
- '!("License" in dataset.dataset_description)'

src/schema/rules/checks/general.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ ReadmeFileSmall:
2020
Please consider expanding it with additional information about the dataset.
2121
level: warning
2222
selectors:
23-
- match(path, '^README')
23+
- match(path, '^/README')
2424
checks:
2525
- size > 150

src/schema/rules/tabular_data/modality_agnostic.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
Participants:
33
selectors:
4-
- path == "participants.tsv"
4+
- path == "/participants.tsv"
55
initial_columns:
66
- participant_id
77
columns:
@@ -20,7 +20,7 @@ Participants:
2020

2121
Samples:
2222
selectors:
23-
- path == "samples.tsv"
23+
- path == "/samples.tsv"
2424
columns:
2525
sample_id: required
2626
participant_id: required

0 commit comments

Comments
 (0)