Skip to content

Commit ee12ab9

Browse files
committed
[validation] Yield all duplicate ids per run
1 parent cce1585 commit ee12ab9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

odml/validation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ def section_unique_ids(parent, id_map=None):
173173
if sec.id in id_map:
174174
yield ValidationError(sec, "Duplicate id in Section '%s' and '%s'" %
175175
(sec.get_path(), id_map[sec.id]))
176-
return
177-
id_map[sec.id] = "Section '%s'" % sec.get_path()
176+
else:
177+
id_map[sec.id] = "Section '%s'" % sec.get_path()
178178

179179
for i in section_unique_ids(sec, id_map):
180180
yield i
@@ -202,8 +202,8 @@ def property_unique_ids(section, id_map=None):
202202
if prop.id in id_map:
203203
yield ValidationError(prop, "Duplicate id in Property '%s' and '%s'" %
204204
(prop.get_path(), id_map[prop.id]))
205-
return
206-
id_map[prop.id] = "Property '%s'" % prop.get_path()
205+
else:
206+
id_map[prop.id] = "Property '%s'" % prop.get_path()
207207

208208

209209
Validation.register_handler('odML', document_unique_ids)

0 commit comments

Comments
 (0)