Skip to content

Commit dfab853

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 215bb9c commit dfab853

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
@@ -722,6 +722,16 @@ def get_first_parent_ref(self, path, tag):
722722
except FileNotFoundError:
723723
return ""
724724
if len(parents) > 1:
725+
for parent in parents:
726+
# iterate back and check tag matches
727+
if not parent.tag.endswith(tag) and not parent.tag.endswith(
728+
"definition"
729+
):
730+
print(
731+
f"Warning: {path} has a mismatching inherited node - {parent.tag} cf {tag}"
732+
)
733+
return ""
734+
725735
parent = parents[1]
726736
parent_path = parent_display_name = parent.attrib["nxdlpath"]
727737
parent_path_segments = parent_path[1:].split("/")

0 commit comments

Comments
 (0)