diff --git a/lib/galaxy/tool_util/linters/general.py b/lib/galaxy/tool_util/linters/general.py index ed87a611da2c..73fd6b73621f 100644 --- a/lib/galaxy/tool_util/linters/general.py +++ b/lib/galaxy/tool_util/linters/general.py @@ -13,7 +13,7 @@ ERROR_ID_MSG = "Tool does not define an id attribute." VALID_ID_MSG = "Tool defines an id [%s]." -PROFILE_PATTERN = re.compile(r"^[1,2]\d\.[0,1]\d$") +PROFILE_PATTERN = re.compile(r"^[12]\d\.(01|05|09|\d)$") PROFILE_INFO_DEFAULT_MSG = "Tool targets 16.01 Galaxy profile." PROFILE_INFO_SPECIFIED_MSG = "Tool specifies profile version [%s]." PROFILE_INVALID_MSG = "Tool specifies an invalid profile version [%s]." diff --git a/test/unit/tool_util/test_tool_linters.py b/test/unit/tool_util/test_tool_linters.py index e9ea77589cfd..0873b9ea67a8 100644 --- a/test/unit/tool_util/test_tool_linters.py +++ b/test/unit/tool_util/test_tool_linters.py @@ -109,6 +109,11 @@ """ +GENERAL_VALID_NEW_PROFILE_FMT = """ + + +""" + # test tool xml for help linter HELP_MULTIPLE = """ @@ -1016,6 +1021,19 @@ def test_general_valid(lint_ctx): assert not lint_ctx.error_messages +def test_general_valid_new_profile_fmt(lint_ctx): + tool_source = get_xml_tool_source(GENERAL_VALID_NEW_PROFILE_FMT) + run_lint(lint_ctx, general.lint_general, XmlToolSource(tool_source)) + assert "Tool defines a version [1.0+galaxy1]." in lint_ctx.valid_messages + assert "Tool specifies profile version [23.0]." in lint_ctx.valid_messages + assert "Tool defines an id [valid_id]." in lint_ctx.valid_messages + assert "Tool defines a name [valid name]." in lint_ctx.valid_messages + assert not lint_ctx.info_messages + assert len(lint_ctx.valid_messages) == 4 + assert not lint_ctx.warn_messages + assert not lint_ctx.error_messages + + def test_help_multiple(lint_ctx): tool_source = get_xml_tool_source(HELP_MULTIPLE) run_lint(lint_ctx, help.lint_help, tool_source)