diff --git a/lib/galaxy/tool_util/linters/output.py b/lib/galaxy/tool_util/linters/output.py index e42c797dca0b..b1d48fd2a60d 100644 --- a/lib/galaxy/tool_util/linters/output.py +++ b/lib/galaxy/tool_util/linters/output.py @@ -85,7 +85,7 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"): return 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