Skip to content

Commit

Permalink
fix(schema): Check paths with initial slashes (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies authored May 24, 2024
1 parent b930a64 commit 40af25c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/schema/rules/checks/dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SubjectFolders:
There are no subject directories (labeled "sub-*") in the root of this dataset.
level: error
selectors:
- path == 'dataset_description.json'
- path == '/dataset_description.json'
checks:
- length(dataset.subjects.sub_dirs) > 0

Expand All @@ -22,7 +22,7 @@ ParticipantIDMismtach:
found in the participants.tsv file.
level: error
selectors:
- path == 'participants.tsv'
- path == '/participants.tsv'
checks:
- sorted(columns.participant_label) == sorted(dataset.subjects.sub_dirs)

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

Expand All @@ -47,7 +47,7 @@ SamplesTSVMissing:
See 'Modality agnostic files' section of the BIDS specification.
level: error
selectors:
- path == 'dataset_description.json'
- path == '/dataset_description.json'
- '"micr" in dataset.modalities'
checks:
- "'samples.tsv' in dataset.files"
Expand All @@ -60,7 +60,7 @@ UnknownVersion:
The BIDS Schema used for validation may be out of date.
level: warning
selectors:
- path == 'dataset_description.json'
- path == '/dataset_description.json'
checks:
- intersects([json.BIDSVersion], schema.meta.versions)

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

Expand All @@ -85,7 +85,7 @@ SingleSourceCitationFields:
The "HowToAckowledge", "License", and "ReferencesAndLinks" fields of
'dataset_description.json' should be removed to avoid inconsistency.
selectors:
- path == 'CITATION.cff'
- path == '/CITATION.cff'
checks:
- '!("HowToAcknowledge" in dataset.dataset_description)'
- '!("License" in dataset.dataset_description)'
Expand Down
2 changes: 1 addition & 1 deletion src/schema/rules/checks/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ ReadmeFileSmall:
Please consider expanding it with additional information about the dataset.
level: warning
selectors:
- match(path, '^README')
- match(path, '^/README')
checks:
- size > 150
4 changes: 2 additions & 2 deletions src/schema/rules/tabular_data/modality_agnostic.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
Participants:
selectors:
- path == "participants.tsv"
- path == "/participants.tsv"
initial_columns:
- participant_id
columns:
Expand All @@ -20,7 +20,7 @@ Participants:

Samples:
selectors:
- path == "samples.tsv"
- path == "/samples.tsv"
columns:
sample_id: required
participant_id: required
Expand Down

0 comments on commit 40af25c

Please sign in to comment.