Skip to content

Commit

Permalink
Merge pull request #19208 from bernt-matthias/OutputsFilterExpression…
Browse files Browse the repository at this point in the history
…-fixes

[24.2]  Outputs filter linter fixes
  • Loading branch information
mvdbeek authored Jan 13, 2025
2 parents bb438e1 + a587336 commit 2d629d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/tool_util/linters/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tool_util/test_tool_linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@
<outputs>
<data name="another_valid_name" format="fasta" label="a label">
<filter>an invalid condition</filter>
<filter>an and condition</filter>
<filter> an and condition </filter>
</data>
<collection name="yet_another_valid_name" type="list" format="fasta" label="another label">
<filter>another invalid condition</filter>
Expand Down

0 comments on commit 2d629d0

Please sign in to comment.