Skip to content

Commit 9acd9f1

Browse files
committed
added check for dataset_description.json presence
1 parent e1b0184 commit 9acd9f1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

validators/bids.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ BIDS = {
149149
participants = null,
150150
phenotypeParticipants = [],
151151
hasSubjectDir = false;
152+
var hasDatasetDescription = false;
152153

153154
var summary = {
154155
sessions: [],
@@ -213,6 +214,11 @@ BIDS = {
213214
hasSubjectDir = true;
214215
}
215216

217+
// check for dataset_description.json presence
218+
if (path === '/dataset_description.json') {
219+
hasDatasetDescription = true;
220+
}
221+
216222
// ignore associated data
217223
if (utils.type.isAssociatedData(file.relativePath)) {
218224
process.nextTick(cb);
@@ -404,6 +410,9 @@ BIDS = {
404410
if (!hasSubjectDir) {
405411
self.issues.push(new Issue({code: 45}));
406412
}
413+
if (!hasDatasetDescription) {
414+
self.issues.push(new Issue({code: 57}));
415+
}
407416
// check if participants file match found subjects
408417

409418
if (participants) {

0 commit comments

Comments
 (0)