Skip to content

Commit bf08cee

Browse files
committed
Rejecting .plain linked resources.
1 parent 52b0e8d commit bf08cee

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

plain_file.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ def check_section_for_linked_resources(section):
100100
if len(link.node.children) != 1:
101101
raise PlainSyntaxError(f"Plain syntax error: Link must have text specified (link: {link.node.target}).")
102102

103+
linked_resource_file_extension = os.path.splitext(os.path.basename(link.node.target))[1]
104+
if linked_resource_file_extension == ".plain":
105+
raise PlainSyntaxError(
106+
f"Referenced resource '{link.node.target}' is a .plain file. "
107+
f"Referencing .plain files through Linked Resources is not supported. "
108+
"Please use the import section to include definitions or implementation/test requirements from another module."
109+
)
110+
103111
linked_resources.append({"text": link.node.children[0].content, "target": link.node.target})
104112

105113
if linked_resources:

0 commit comments

Comments
 (0)