Skip to content

Commit

Permalink
Consider only regex as regular expression
Browse files Browse the repository at this point in the history
`expression` is just a Python (eval) expression.
  • Loading branch information
davelopez committed Sep 13, 2023
1 parent 5866764 commit 8d636ef
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/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def lint_inputs(tool_source: "ToolSource", lint_ctx: "LintContext"):
lint_ctx.error(
f"Parameter [{param_name}]: {vtype} validators are expected to contain text", node=validator
)
else:
elif vtype == "regex":
try:
re.compile(validator.text)
except Exception as 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 @@ -410,7 +410,7 @@
<validator type="in_range">TEXT</validator>
<validator type="regex" filename="blah"/>
<validator type="expression"/>
<validator type="expression">[</validator>
<validator type="regex">[</validator>
<validator type="value_in_data_table"/>
</param>
<param name="another_param_name" type="data" format="bed">
Expand Down

0 comments on commit 8d636ef

Please sign in to comment.