From 2fae49ec4cf900d9f9562d83a8eb83dafbfd78b7 Mon Sep 17 00:00:00 2001 From: Joey Dufourd Date: Mon, 22 Jun 2026 11:33:53 +0200 Subject: [PATCH 1/2] test: cover val substring in emit names --- tests/modules/lint/test_main_nf.py | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/modules/lint/test_main_nf.py b/tests/modules/lint/test_main_nf.py index 399edc900f..b14b4b644f 100644 --- a/tests/modules/lint/test_main_nf.py +++ b/tests/modules/lint/test_main_nf.py @@ -416,6 +416,38 @@ def test_get_outputs_no_partial_keyword_match(tmp_path): assert "reads" in component.outputs assert '"*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz"' in list(component.outputs["reads"][0][1].keys()) +def test_get_outputs_no_partial_keyword_match_in_emit_name(tmp_path): + """Test that output parsing does not match val inside emit names like peak_values""" + main_nf_content = """ +process TEST_PROCESS { + input: + val(meta) + + output: + path "*peak_values.nii.gz", emit: peak_values + + script: + "echo test" +} +""" + main_nf_path = tmp_path / "main.nf" + main_nf_path.write_text(main_nf_content) + + component = NFCoreComponent( + component_name="test", + repo_url=None, + component_dir=tmp_path, + repo_type="modules", + base_dir=tmp_path, + component_type="modules", + remote_component=False, + ) + + component.get_outputs_from_main_nf() + + assert component.outputs == { + "peak_values": [{"\"*peak_values.nii.gz\"": {"_keyword": "path"}}] + } def test_get_outputs_complete_version_command(tmp_path): """Test that the version command is complete with both eval() and val()""" From d4a0b08ae6bf07952a466feafae698a4dfbe5923 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Mon, 22 Jun 2026 11:25:51 +0000 Subject: [PATCH 2/2] [automated] Fix code linting --- tests/modules/lint/test_main_nf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modules/lint/test_main_nf.py b/tests/modules/lint/test_main_nf.py index b14b4b644f..13a0915fe1 100644 --- a/tests/modules/lint/test_main_nf.py +++ b/tests/modules/lint/test_main_nf.py @@ -416,6 +416,7 @@ def test_get_outputs_no_partial_keyword_match(tmp_path): assert "reads" in component.outputs assert '"*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz"' in list(component.outputs["reads"][0][1].keys()) + def test_get_outputs_no_partial_keyword_match_in_emit_name(tmp_path): """Test that output parsing does not match val inside emit names like peak_values""" main_nf_content = """ @@ -445,9 +446,8 @@ def test_get_outputs_no_partial_keyword_match_in_emit_name(tmp_path): component.get_outputs_from_main_nf() - assert component.outputs == { - "peak_values": [{"\"*peak_values.nii.gz\"": {"_keyword": "path"}}] - } + assert component.outputs == {"peak_values": [{'"*peak_values.nii.gz"': {"_keyword": "path"}}]} + def test_get_outputs_complete_version_command(tmp_path): """Test that the version command is complete with both eval() and val()"""