Skip to content

Commit

Permalink
Reuse is_datasource instead of duplicating code
Browse files Browse the repository at this point in the history
  • Loading branch information
wm75 committed Feb 23, 2024
1 parent 82ca92a commit 2554a1b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/galaxy/tool_util/linters/xml_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2554a1b

Please sign in to comment.