INNER CODE UNIT · Python
_populate_versions_metadata
nf-core/tools · nf_core/modules/lint/__init__.py:527
def _populate_versions_metadata(section_name: str, section_data: dict) -> None:
"""Add template metadata to versions_* channels and topics.versions"""
# Get the corresponding source data (mod.outputs or mod.topics) to check keywords
source_data = mod.outputs if section_name == "output" else mod.topics
for ch_name, ch_data in section_data.items():
# Only process versions_* outputs or "versions" topic
if (section_name == "output" and ch_name.startswith("versions_")) or (
section_name == "topics" and ch_name == "versions"
):
# Get source channel name (for topics, it's always "versions")
source_ch_name = "versions" if section_name == "topics" else ch_name
if source_ch_name not in source_data:
continue
for i, ch_content in enumerate(ch_data):
if isinstance(ch_content, list) and i < len(source_data[source_ch_name]):
for j, element in enumerate(ch_content):