INNER CODE UNIT · Python
_process_element
nf-core/tools · nf_core/modules/lint/__init__.py:433
def _process_element(element, index, is_output=False):
"""Process a single element: normalize name, get metadata, adjust for topics."""
element_name = list(element.keys())[0]
normalized_name = unquote(element_name)
# Ensure normalized_name is always a string (e.g., convert 1.2 -> "1.2")
normalized_name = str(normalized_name)
element_meta = _find_meta_info(meta_yml_io, element_name, is_output=is_output)
# For topics, handle type field based on keyword
if io_type == "topics":
keyword = element.get(element_name, {}).get("_keyword", "")
# If no existing metadata, use template defaults
if not element_meta:
element_meta = topic_metadata[index].copy() if index < len(topic_metadata) else {}
log.debug(f"Adding topic metadata for '{normalized_name}' at index {index}: {element_meta}")
# Adjust type field based on keyword (val -> string, eval -> eval)