From 2554a1b6b95870ac169b451e4a37bc0d7863c4e6 Mon Sep 17 00:00:00 2001 From: Wolfgang Maier Date: Fri, 23 Feb 2024 10:59:07 +0100 Subject: [PATCH] Reuse is_datasource instead of duplicating code --- lib/galaxy/tool_util/linters/xml_order.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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