diff --git a/lib/galaxy/tool_util/linters/output.py b/lib/galaxy/tool_util/linters/output.py index e9ab7c4aaf4e..b1d48fd2a60d 100644 --- a/lib/galaxy/tool_util/linters/output.py +++ b/lib/galaxy/tool_util/linters/output.py @@ -83,9 +83,9 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"): tool_xml = getattr(tool_source, "xml_tree", None) if not tool_xml: return - for filter in tool_xml.findall("./outputs//filter"): + for filter in tool_xml.findall("./outputs/*/filter"): try: - ast.parse(filter.text, mode="eval") + ast.parse(filter.text.strip(), mode="eval") except Exception as e: lint_ctx.warn( f"Filter '{filter.text}' is no valid expression: {str(e)}", diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index ea7f4cd8d5d5..867e85dc2ba3 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -656,7 +656,7 @@ an invalid condition - an and condition + an and condition another invalid condition