Skip to content

Commit 2d629d0

Browse files
authored
Merge pull request #19208 from bernt-matthias/OutputsFilterExpression-fixes
[24.2] Outputs filter linter fixes
2 parents bb438e1 + a587336 commit 2d629d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/galaxy/tool_util/linters/output.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"):
8383
tool_xml = getattr(tool_source, "xml_tree", None)
8484
if not tool_xml:
8585
return
86-
for filter in tool_xml.findall("./outputs//filter"):
86+
for filter in tool_xml.findall("./outputs/*/filter"):
8787
try:
88-
ast.parse(filter.text, mode="eval")
88+
ast.parse(filter.text.strip(), mode="eval")
8989
except Exception as e:
9090
lint_ctx.warn(
9191
f"Filter '{filter.text}' is no valid expression: {str(e)}",

test/unit/tool_util/test_tool_linters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@
656656
<outputs>
657657
<data name="another_valid_name" format="fasta" label="a label">
658658
<filter>an invalid condition</filter>
659-
<filter>an and condition</filter>
659+
<filter> an and condition </filter>
660660
</data>
661661
<collection name="yet_another_valid_name" type="list" format="fasta" label="another label">
662662
<filter>another invalid condition</filter>

0 commit comments

Comments
 (0)