Skip to content

Commit 3a47a48

Browse files
authored
Merge pull request #3535 from toniher/fix-output-detection-in-lint-3513
adding boundary in regex for fixing #3513
2 parents 083d157 + 1208390 commit 3a47a48

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.11.2 ([#3521](https://github.com/nf-core/tools/pull/3521))
6161
- Fix indentation in included_configs API docs ([#3523](https://github.com/nf-core/tools/pull/3523))
6262
- chore(deps): update python:3.12-slim docker digest to a866731 ([#3527](https://github.com/nf-core/tools/pull/3527))
63+
- adding boundary in regex ([#3535](https://github.com/nf-core/tools/pull/3535))
6364
- switch to using runsOn runners in nf-core/tools repo ([#3537](https://github.com/nf-core/tools/pull/3537))
6465

6566
## [v3.2.0 - Pewter Pangolin](https://github.com/nf-core/tools/releases/tag/3.2.0) - [2025-01-27]

nf_core/components/nfcore_component.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def get_inputs_from_main_nf(self) -> None:
207207
for line in input_data.split("\n"):
208208
channel_elements: Any = []
209209
line = line.split("//")[0] # remove any trailing comments
210-
regex = r"(val|path)\s*(\(([^)]+)\)|\s*([^)\s,]+))"
210+
regex = r"\b(val|path)\s*(\(([^)]+)\)|\s*([^)\s,]+))"
211211
matches = re.finditer(regex, line)
212212
for _, match in enumerate(matches, start=1):
213213
input_val = None
@@ -247,7 +247,7 @@ def get_outputs_from_main_nf(self):
247247
return outputs
248248
output_data = data.split("output:")[1].split("when:")[0]
249249
regex_emit = r"emit:\s*([^)\s,]+)"
250-
regex_elements = r"(val|path|env|stdout)\s*(\(([^)]+)\)|\s*([^)\s,]+))"
250+
regex_elements = r"\b(val|path|env|stdout)\s*(\(([^)]+)\)|\s*([^)\s,]+))"
251251
for line in output_data.split("\n"):
252252
match_emit = re.search(regex_emit, line)
253253
matches_elements = re.finditer(regex_elements, line)

0 commit comments

Comments
 (0)