diff --git a/planemo/commands/cmd_lint.py b/planemo/commands/cmd_lint.py index 85a3c77cc..6b9f19d66 100644 --- a/planemo/commands/cmd_lint.py +++ b/planemo/commands/cmd_lint.py @@ -1,9 +1,11 @@ """Module describing the planemo ``lint`` command.""" import click +from galaxy.tool_util.lint import Linter from planemo import options from planemo.cli import command_function +from planemo.io import error from planemo.tool_lint import ( build_tool_lint_args, lint_tools_on_path, @@ -46,6 +48,12 @@ def cli(ctx, uris, **kwds): """Check for common errors and best practices.""" lint_args = build_tool_lint_args(ctx, **kwds) + + linters = Linter.list_linters() + invalid_skip_types = list(set(lint_args["skip_types"]) - set(linters)) + if len(invalid_skip_types): + error(f"Unknown linter type(s) {invalid_skip_types} in list of linters to be skipped. Known linters {linters}") + exit_code = lint_tools_on_path(ctx, uris, lint_args, recursive=kwds["recursive"]) # TODO: rearchitect XUnit. diff --git a/planemo/lint.py b/planemo/lint.py index c14247e7a..618bb61ed 100644 --- a/planemo/lint.py +++ b/planemo/lint.py @@ -4,10 +4,7 @@ from urllib.request import urlopen import requests -from galaxy.tool_util.lint import ( - LintContext, - Linter, -) +from galaxy.tool_util.lint import LintContext from planemo.io import error from planemo.shed import find_urls_for_xml @@ -34,11 +31,6 @@ def build_lint_args(ctx, **kwds): continue skip_types.append(line) - linters = Linter.list_linters() - invalid_skip_types = list(set(skip_types) - set(linters)) - if len(invalid_skip_types): - error(f"Unknown linter type(s) {invalid_skip_types} in list of linters to be skipped. Known linters {linters}") - lint_args = dict( level=report_level, fail_level=fail_level,