bundlewrap/hooks/unique_node_ids.py
2025-12-01 20:57:16 +01:00

14 lines
463 B
Python

def test_unique_node_ids(repo):
ids = {}
for node in repo.nodes:
if node.metadata.get('id') in ids:
raise ValueError(f"Duplicate node ID found: {node.metadata.get('id')} in node {node.name} and {ids[node.metadata.get('id')]}")
ids[node.metadata.get('id')] = node.name
def apply_start(repo, target, nodes, interactive=False, **kwargs):
test_unique_node_ids(repo)
def test(repo, **kwargs):
test_unique_node_ids(repo)