Skip to content

Commit

Permalink
Use lint_xml_with for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Sep 21, 2022
1 parent 0f68839 commit e81080c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/galaxyls/services/tools/linting.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from typing import List

from galaxy.tool_util.lint import (
lint_tool_source_with,
lint_xml_with,
LintContext,
LintLevel,
XMLLintMessageXPath,
)
from galaxy.tool_util.parser import get_tool_source
from pygls.lsp.types import (
Diagnostic,
DiagnosticSeverity,
Expand All @@ -25,9 +24,8 @@ def lint_document(self, xml_document: XmlDocument) -> List[Diagnostic]:
xml_tree = xml_document.xml_tree_expanded
if not xml_document.is_tool_file or xml_tree is None:
return result
tool_source = get_tool_source(xml_tree=xml_tree)
lint_context = LintContext(level=LintLevel.SILENT, lint_message_class=XMLLintMessageXPath)
context = lint_tool_source_with(lint_context, tool_source)
context = lint_xml_with(lint_context, xml_tree)
result.extend(
[
self._to_diagnostic(lint_message, xml_document, DiagnosticSeverity.Error)
Expand Down

0 comments on commit e81080c

Please sign in to comment.