Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check lint skip types only for tool linting #1465

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions planemo/commands/cmd_lint.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 1 addition & 9 deletions planemo/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down