Skip to content

Commit

Permalink
Merge pull request #871 from jmchilton/xml-lint-name
Browse files Browse the repository at this point in the history
Improved XSD lint reporting.
  • Loading branch information
jmchilton authored Sep 14, 2018
2 parents 393aeb2 + cd80c05 commit a42c4bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions planemo/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def is_doi(publication_id, lint_ctx):

def lint_xsd(lint_ctx, schema_path, path):
"""Lint XML at specified path with supplied schema."""
name = os.path.basename(path)
name = lint_ctx.object_name or os.path.basename(path)
validator = validation.get_validator(require=True)
validation_result = validator.validate(schema_path, path)
if not validation_result.passed:
msg = "Invalid %s found. Errors [%s]"
msg = "Invalid XML found in file: %s. Errors [%s]"
msg = msg % (name, validation_result.output)
lint_ctx.error(msg)
else:
Expand Down
4 changes: 3 additions & 1 deletion planemo/tool_lint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import absolute_import

from os.path import basename

from galaxy.tools.lint import lint_tool_source

from planemo.exit_codes import (
Expand Down Expand Up @@ -28,7 +30,7 @@ def lint_tools_on_path(ctx, paths, lint_args, **kwds):
exit_codes.append(EXIT_CODE_GENERIC_FAILURE)
continue
info("Linting tool %s" % tool_path)
if not lint_tool_source(tool_xml, **lint_args):
if not lint_tool_source(tool_xml, name=basename(tool_path), **lint_args):
error("Failed linting")
exit_codes.append(EXIT_CODE_GENERIC_FAILURE)
else:
Expand Down

0 comments on commit a42c4bf

Please sign in to comment.