Skip to content

Commit

Permalink
check lint skip types only for tool linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Jul 3, 2024
1 parent 53ccca4 commit 8044da8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 9 additions & 0 deletions planemo/commands/cmd_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

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,
)

from galaxy.tool_util.lint import Linter


@click.command("lint")
@options.optional_tools_arg(multiple=True, allow_uris=True)
Expand Down Expand Up @@ -46,6 +49,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

0 comments on commit 8044da8

Please sign in to comment.