Skip to content

Commit a42c4bf

Browse files
authored
Merge pull request #871 from jmchilton/xml-lint-name
Improved XSD lint reporting.
2 parents 393aeb2 + cd80c05 commit a42c4bf

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

planemo/lint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ def is_doi(publication_id, lint_ctx):
109109

110110
def lint_xsd(lint_ctx, schema_path, path):
111111
"""Lint XML at specified path with supplied schema."""
112-
name = os.path.basename(path)
112+
name = lint_ctx.object_name or os.path.basename(path)
113113
validator = validation.get_validator(require=True)
114114
validation_result = validator.validate(schema_path, path)
115115
if not validation_result.passed:
116-
msg = "Invalid %s found. Errors [%s]"
116+
msg = "Invalid XML found in file: %s. Errors [%s]"
117117
msg = msg % (name, validation_result.output)
118118
lint_ctx.error(msg)
119119
else:

planemo/tool_lint.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import absolute_import
22

3+
from os.path import basename
4+
35
from galaxy.tools.lint import lint_tool_source
46

57
from planemo.exit_codes import (
@@ -28,7 +30,7 @@ def lint_tools_on_path(ctx, paths, lint_args, **kwds):
2830
exit_codes.append(EXIT_CODE_GENERIC_FAILURE)
2931
continue
3032
info("Linting tool %s" % tool_path)
31-
if not lint_tool_source(tool_xml, **lint_args):
33+
if not lint_tool_source(tool_xml, name=basename(tool_path), **lint_args):
3234
error("Failed linting")
3335
exit_codes.append(EXIT_CODE_GENERIC_FAILURE)
3436
else:

0 commit comments

Comments
 (0)