Skip to content

Commit 06d35de

Browse files
committed
Ensure any reference to inherited nodes match tag type
This fixes the CI issue for #1560 where a `model` field collides with `model` attribute
1 parent 0463570 commit 06d35de

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

dev_tools/docs/nxdl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,16 @@ def get_first_parent_ref(self, path, tag):
723723
except FileNotFoundError:
724724
return ""
725725
if len(parents) > 1:
726+
for parent in parents:
727+
# iterate back and check tag matches
728+
if not parent.tag.endswith(tag) and not parent.tag.endswith(
729+
"definition"
730+
):
731+
print(
732+
f"Warning: {path} has a mismatching inherited node - {parent.tag} cf {tag}"
733+
)
734+
return ""
735+
726736
parent = parents[1]
727737
parent_path = parent_display_name = parent.attrib["nxdlpath"]
728738
parent_path_segments = parent_path[1:].split("/")

0 commit comments

Comments
 (0)