Skip to content

Commit

Permalink
make the 440 version linter an error
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Apr 19, 2023
1 parent ca2e035 commit 5d52d3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/linters/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def lint_general(tool_source, lint_ctx):
if not version:
lint_ctx.error(ERROR_VERSION_MSG, node=tool_node)
elif isinstance(parsed_version, packaging.version.LegacyVersion):
lint_ctx.warn(WARN_VERSION_MSG % version, node=tool_node)
lint_ctx.error(WARN_VERSION_MSG % version, node=tool_node)
elif version != version.strip():
lint_ctx.warn(WARN_WHITESPACE_PRESUFFIX % ("Tool version", version), node=tool_node)
else:
Expand Down
6 changes: 3 additions & 3 deletions test/unit/tool_util/test_tool_linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,16 +981,16 @@ def test_general_whitespace_in_versions_and_names(lint_ctx):
def test_general_requirement_without_version(lint_ctx):
tool_source = get_xml_tool_source(GENERAL_REQUIREMENT_WO_VERSION)
run_lint(lint_ctx, general.lint_general, XmlToolSource(tool_source))
assert "Tool version [1.0.1blah] is not compliant with PEP 440." in lint_ctx.warn_messages
assert "Tool version [1.0.1blah] is not compliant with PEP 440." in lint_ctx.error_messages
assert "Requirement bwa defines no version" in lint_ctx.warn_messages
assert "Requirement without name found" in lint_ctx.error_messages
assert "Tool specifies profile version [20.09]." in lint_ctx.valid_messages
assert "Tool defines an id [bwa_tool]." in lint_ctx.valid_messages
assert "Tool defines a name [BWA Mapper]." in lint_ctx.valid_messages
assert not lint_ctx.info_messages
assert len(lint_ctx.valid_messages) == 3
assert len(lint_ctx.warn_messages) == 2
assert len(lint_ctx.error_messages) == 1
assert len(lint_ctx.warn_messages) == 1
assert len(lint_ctx.error_messages) == 2


def test_general_valid(lint_ctx):
Expand Down

0 comments on commit 5d52d3e

Please sign in to comment.