From b08466978169692c6f1db11511fe5f8efccac717 Mon Sep 17 00:00:00 2001 From: Ammar Aziz Date: Thu, 15 Jan 2026 23:33:33 +1100 Subject: [PATCH] added helpful comment for common gotcha - prefix scoping --- nf_core/module-template/main.nf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nf_core/module-template/main.nf b/nf_core/module-template/main.nf index 49802b58c9..fd04aa8802 100644 --- a/nf_core/module-template/main.nf +++ b/nf_core/module-template/main.nf @@ -78,6 +78,9 @@ process {{ component_name_underscore|upper }} { script: def args = task.ext.args ?: '' {% if has_meta -%} + // TODO nf-core: The $prefix variable as defined below is ONLY available within the script block. + // If $prefix is required elsewhere (eg in output block), remove the def keyword. + // For further information on variable scope see https://midnighter.github.io/nextflow-gotchas/gotchas/variable-scope/ def prefix = task.ext.prefix ?: "${meta.id}" {%- endif %} {% if not_empty_template -%}