@@ -90,6 +90,7 @@ def main_nf(
9090 process_lines = []
9191 script_lines = []
9292 shell_lines = []
93+ exec_lines = []
9394 when_lines = []
9495 iter_lines = iter (lines )
9596 for line in iter_lines :
@@ -110,6 +111,9 @@ def main_nf(
110111 if re .search (r"^\s*shell\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
111112 state = "shell"
112113 continue
114+ if re .search (r"^\s*exec\s*:" , line ) and state in ["input" , "output" , "when" , "process" ]:
115+ state = "exec"
116+ continue
113117
114118 # Perform state-specific linting checks
115119 if state == "process" and not _is_empty (line ):
@@ -132,6 +136,8 @@ def main_nf(
132136 script_lines .append (line )
133137 if state == "shell" and not _is_empty (line ):
134138 shell_lines .append (line )
139+ if state == "exec" and not _is_empty (line ):
140+ exec_lines .append (line )
135141
136142 # Check that we have required sections
137143 if not len (outputs ):
@@ -149,8 +155,10 @@ def main_nf(
149155 check_when_section (module , when_lines )
150156
151157 # Check that we have script or shell, not both
152- if len (script_lines ) and len (shell_lines ):
153- module .failed .append (("main_nf_script_shell" , "Script and Shell found, should use only one" , module .main_nf ))
158+ if sum (bool (block_lines ) for block_lines in (script_lines , shell_lines , exec_lines )) > 1 :
159+ module .failed .append (
160+ ("main_nf_script_shell" , "Multiple script:/shell:/exec: blocks found, should use only one" , module .main_nf )
161+ )
154162
155163 # Check the script definition
156164 if len (script_lines ):
0 commit comments