diff --git a/lib/galaxy/tool_util/linters/outputs.py b/lib/galaxy/tool_util/linters/outputs.py index 7d244d7a690e..8b969022e908 100644 --- a/lib/galaxy/tool_util/linters/outputs.py +++ b/lib/galaxy/tool_util/linters/outputs.py @@ -45,7 +45,14 @@ def lint_output(tool_xml, lint_ctx): label = output.attrib.get("label", "${tool.name} on ${on_string}") if label in labels: - lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output) + filter_node = output.find(".//filter") + if filter_node is not None: + lint_ctx.info( + f"Tool output [{name}] uses duplicated label '{label}', double check if filters imply disjoint cases", + node=output + ) + else: + lint_ctx.error(f"Tool output [{name}] uses duplicated label '{label}'", node=output) labels.add(label) format_set = False diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index 089c07dd02a6..27576da50849 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -538,6 +538,12 @@ + + a condition + + + another condition + """ @@ -1410,8 +1416,12 @@ def test_outputs_discover_tool_provided_metadata(lint_ctx): def test_outputs_duplicated_name_label(lint_ctx): tool_source = get_xml_tool_source(OUTPUTS_DUPLICATED_NAME_LABEL) run_lint(lint_ctx, outputs.lint_output, tool_source) - assert "2 outputs found." in lint_ctx.info_messages - assert len(lint_ctx.info_messages) == 1 + assert "4 outputs found." in lint_ctx.info_messages + assert ( + "Tool output [yet_another_valid_name] uses duplicated label 'same label may be OK if there is a filter', double check if filters imply disjoint cases" + in lint_ctx.info_messages + ) + assert len(lint_ctx.info_messages) == 2 assert not lint_ctx.valid_messages assert not lint_ctx.warn_messages assert "Tool output [valid_name] has duplicated name" in lint_ctx.error_messages