From 05c52e6c158eecddc053f3f0e487128850509b55 Mon Sep 17 00:00:00 2001 From: Matthieu Muffato Date: Fri, 20 Jun 2025 16:46:31 +0100 Subject: [PATCH 1/2] Support modules with exec: blocks --- nf_core/modules/lint/main_nf.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index d5a174237e..063fc354fa 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -90,6 +90,7 @@ def main_nf( process_lines = [] script_lines = [] shell_lines = [] + exec_lines = [] when_lines = [] iter_lines = iter(lines) for line in iter_lines: @@ -110,6 +111,9 @@ def main_nf( if re.search(r"^\s*shell\s*:", line) and state in ["input", "output", "when", "process"]: state = "shell" continue + if re.search(r"^\s*exec\s*:", line) and state in ["input", "output", "when", "process"]: + state = "exec" + continue # Perform state-specific linting checks if state == "process" and not _is_empty(line): @@ -132,6 +136,8 @@ def main_nf( script_lines.append(line) if state == "shell" and not _is_empty(line): shell_lines.append(line) + if state == "exec" and not _is_empty(line): + exec_lines.append(line) # Check that we have required sections if not len(outputs): @@ -149,8 +155,10 @@ def main_nf( check_when_section(module, when_lines) # Check that we have script or shell, not both - if len(script_lines) and len(shell_lines): - module.failed.append(("main_nf_script_shell", "Script and Shell found, should use only one", module.main_nf)) + if sum(bool(block_lines) for block_lines in (script_lines, shell_lines, exec_lines)) > 1: + module.failed.append( + ("main_nf_script_shell", "Multiple script:/shell:/exec: blocks found, should use only one", module.main_nf) + ) # Check the script definition if len(script_lines): From 6975c28c9f6686ac147030c5c1749be85b39ce22 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Fri, 20 Jun 2025 15:49:54 +0000 Subject: [PATCH 2/2] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e305850c4..cf2d781f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ ### Modules - Remove args stub from module template to satisfy language server ([#3403](https://github.com/nf-core/tools/pull/3403)) +- Support modules with `exec:` blocks ([#3633](https://github.com/nf-core/tools/pull/3633)) ### Subworkflows