Skip to content

Commit cc38f8d

Browse files
authored
Merge branch 'dev' into fix-linting-error
2 parents 3cc7646 + b2132cf commit cc38f8d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
- allow mixed `str` and `dict` entries in lint config ([#3228](https://github.com/nf-core/tools/pull/3228))
2828
- fix meta_yml linting test failing due to module.process_name always being "" ([#3317](https://github.com/nf-core/tools/pull/3317))
29+
- fix module section regex matching wrong things ([#3321](https://github.com/nf-core/tools/pull/3321))
2930

3031
### Modules
3132

nf_core/modules/lint/main_nf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ def main_nf(
9696
for line in iter_lines:
9797
if re.search(r"^\s*process\s*\w*\s*{", line) and state == "module":
9898
state = "process"
99-
if re.search(r"input\s*:", line) and state in ["process"]:
99+
if re.search(r"^\s*input\s*:", line) and state in ["process"]:
100100
state = "input"
101101
continue
102-
if re.search(r"output\s*:", line) and state in ["input", "process"]:
102+
if re.search(r"^\s*output\s*:", line) and state in ["input", "process"]:
103103
state = "output"
104104
continue
105-
if re.search(r"when\s*:", line) and state in ["input", "output", "process"]:
105+
if re.search(r"^\s*when\s*:", line) and state in ["input", "output", "process"]:
106106
state = "when"
107107
continue
108-
if re.search(r"script\s*:", line) and state in ["input", "output", "when", "process"]:
108+
if re.search(r"^\s*script\s*:", line) and state in ["input", "output", "when", "process"]:
109109
state = "script"
110110
continue
111-
if re.search(r"shell\s*:", line) and state in ["input", "output", "when", "process"]:
111+
if re.search(r"^\s*shell\s*:", line) and state in ["input", "output", "when", "process"]:
112112
state = "shell"
113113
continue
114114

0 commit comments

Comments
 (0)