Skip to content

Commit

Permalink
strip text
Browse files Browse the repository at this point in the history
otherwise the parser gives an indentation error

also: we strip the text alo in the application
  • Loading branch information
bernt-matthias committed Nov 26, 2024
1 parent 9cae33f commit a587336
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/linters/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}",
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 a587336

Please sign in to comment.