Skip to content

Commit f27e2c8

Browse files
authored
Apply suggestion from @mashehu
1 parent 3e6859d commit f27e2c8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

nf_core/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,12 @@ def read_module_name(main_nf: Path) -> str | None:
412412
"""Return the process name declared in a Nextflow ``main.nf`` file, or ``None``."""
413413

414414
_NF_PROCESS_NAME_RE = re.compile(r"^\s*process\s+(\w+)\s*\{", re.MULTILINE)
415-
try:
415+
416+
417+
_NF_PROCESS_NAME_RE = re.compile(r"^\s*process\s+(\w+)\s*\{", re.MULTILINE)
418+
419+
def read_module_name(main_nf: Path) -> str | None:
420+
"""Return the process name declared in a Nextflow ``main.nf`` file, or ``None``."""
416421
match = _NF_PROCESS_NAME_RE.search(main_nf.read_text())
417422
return match.group(1) if match else None
418423
except OSError:

0 commit comments

Comments
 (0)