diff --git a/lib/galaxy/tool_util/linters/xml_order.py b/lib/galaxy/tool_util/linters/xml_order.py index 6ead8908c2b2..13132e909c45 100644 --- a/lib/galaxy/tool_util/linters/xml_order.py +++ b/lib/galaxy/tool_util/linters/xml_order.py @@ -4,16 +4,18 @@ https://github.com/galaxy-iuc/standards. """ -from typing import TYPE_CHECKING +from typing import ( + Optional, + TYPE_CHECKING, +) from galaxy.tool_util.lint import Linter +from ._util import is_datasource if TYPE_CHECKING: from galaxy.tool_util.lint import LintContext from galaxy.tool_util.parser.interface import ToolSource -from typing import Optional - # https://github.com/galaxy-iuc/standards # https://github.com/galaxy-iuc/standards/pull/7/files TAG_ORDER = [ @@ -63,7 +65,7 @@ def lint(cls, tool_source: "ToolSource", lint_ctx: "LintContext"): return tool_root = tool_xml.getroot() - if tool_root.attrib.get("tool_type", "") in ["data_source", "data_source_async"]: + if is_datasource(tool_xml): tag_ordering = DATASOURCE_TAG_ORDER else: tag_ordering = TAG_ORDER