Beispiel #1
0
def lint_conda_recipe(ctx, recipe_dir, **kwds):
    info("Linting conda recipe %s" % recipe_dir)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)

    def apply(f):
        lint_ctx.lint(f.__name__, f, recipe_dir)

    apply(lint_name)
    apply(lint_version)
    apply(lint_summary)
    apply(lint_build_number)
    apply(lint_directory_content)
    apply(lint_license_family)
    apply(lint_about_urls)
    apply(lint_source)
    apply(lint_fields)
    apply(lint_requirements)

    return handle_lint_complete(lint_ctx, lint_args)
Beispiel #2
0
def lint_conda_recipe(ctx, recipe_dir, **kwds):
    info("Linting conda recipe %s" % recipe_dir)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)

    def apply(f):
        lint_ctx.lint(f.__name__, f, recipe_dir)

    apply(lint_name)
    apply(lint_version)
    apply(lint_summary)
    apply(lint_build_number)
    apply(lint_directory_content)
    apply(lint_license_family)
    apply(lint_about_urls)
    apply(lint_source)
    apply(lint_fields)
    apply(lint_requirements)

    return handle_lint_complete(lint_ctx, lint_args)
Beispiel #3
0
def lint_repository(ctx, realized_repository, **kwds):
    """Lint a realized shed repository.

    See :module:`planemo.shed` for details on constructing a realized
    repository data structure.
    """
    failed = False
    path = realized_repository.real_path
    info("Linting repository %s" % path)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)
    lint_ctx.lint(
        "lint_expansion",
        lint_expansion,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_expected_files",
        lint_expected_files,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_xsd",
        lint_tool_dependencies_xsd,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_sha256sum",
        lint_tool_dependencies_sha256sum,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_actions",
        lint_tool_dependencies_actions,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_repository_dependencies",
        lint_repository_dependencies,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_shed_yaml",
        lint_shed_yaml,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_readme",
        lint_readme,
        realized_repository,
    )
    if kwds["urls"]:
        lint_ctx.lint(
            "lint_urls",
            lint_tool_dependencies_urls,
            realized_repository,
        )
    if kwds["tools"]:
        tools_failed = lint_repository_tools(ctx, realized_repository, lint_ctx, lint_args)
        failed = failed or tools_failed
    if kwds["ensure_metadata"]:
        lint_ctx.lint(
            "lint_shed_metadata",
            lint_shed_metadata,
            realized_repository,
        )
    return handle_lint_complete(lint_ctx, lint_args, failed=failed)
Beispiel #4
0
def lint_repository(ctx, realized_repository, **kwds):
    """Lint a realized shed repository.

    See :mod:`planemo.shed` for details on constructing a realized
    repository data structure.
    """
    failed = False
    path = realized_repository.real_path
    info("Linting repository %s" % path)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)
    lint_ctx.lint(
        "lint_expansion",
        lint_expansion,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_expected_files",
        lint_expected_files,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_xsd",
        lint_tool_dependencies_xsd,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_sha256sum",
        lint_tool_dependencies_sha256sum,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_actions",
        lint_tool_dependencies_actions,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_repository_dependencies",
        lint_repository_dependencies,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_shed_yaml",
        lint_shed_yaml,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_readme",
        lint_readme,
        realized_repository,
    )
    if kwds["urls"]:
        lint_ctx.lint(
            "lint_urls",
            lint_tool_dependencies_urls,
            realized_repository,
        )
    if kwds["tools"]:
        tools_failed = lint_repository_tools(ctx, realized_repository, lint_ctx, lint_args)
        failed = failed or tools_failed
    if kwds["ensure_metadata"]:
        lint_ctx.lint(
            "lint_shed_metadata",
            lint_shed_metadata,
            realized_repository,
        )
    return handle_lint_complete(lint_ctx, lint_args, failed=failed)
Beispiel #5
0
def lint_repository(ctx, realized_repository, **kwds):
    """Lint a realized shed repository.

    See :module:`planemo.shed` for details on constructing a realized
    repository data structure.
    """
    # TODO: this really needs to start working with realized path.
    failed = False
    path = realized_repository.real_path
    info("Linting repository %s" % path)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)
    lint_ctx.lint(
        "lint_expansion",
        lint_expansion,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_expected_files",
        lint_expected_files,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_xsd",
        lint_tool_dependencies_xsd,
        path,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_sha256sum",
        lint_tool_dependencies_sha256sum,
        path,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_actions",
        lint_tool_dependencies_actions,
        path,
    )
    lint_ctx.lint(
        "lint_repository_dependencies",
        lint_repository_dependencies,
        path,
    )
    lint_ctx.lint(
        "lint_shed_yaml",
        lint_shed_yaml,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_readme",
        lint_readme,
        path,
    )
    if kwds["urls"]:
        lint_ctx.lint(
            "lint_urls",
            lint_tool_dependencies_urls,
            path,
        )
    if kwds["tools"]:
        for (tool_path, tool_source) in yield_tool_sources(ctx, path,
                                                           recursive=True):
            info("+Linting tool %s" % tool_path)
            if handle_tool_load_error(tool_path, tool_source):
                failed = True
                continue
            lint_tool_source_with(
                lint_ctx,
                tool_source,
                extra_modules=lint_args["extra_modules"]
            )
    if kwds["ensure_metadata"]:
        lint_ctx.lint(
            "lint_shed_metadata",
            lint_shed_metadata,
            realized_repository,
        )
    return handle_lint_complete(lint_ctx, lint_args, failed=failed)
Beispiel #6
0
def lint_repository(ctx, realized_repository, **kwds):
    """Lint a realized shed repository.

    See :module:`planemo.shed` for details on constructing a realized
    repository data structure.
    """
    # TODO: this really needs to start working with realized path.
    failed = False
    path = realized_repository.real_path
    info("Linting repository %s" % path)
    lint_args, lint_ctx = setup_lint(ctx, **kwds)
    lint_ctx.lint(
        "lint_expansion",
        lint_expansion,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_expected_files",
        lint_expected_files,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_xsd",
        lint_tool_dependencies_xsd,
        path,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_sha256sum",
        lint_tool_dependencies_sha256sum,
        path,
    )
    lint_ctx.lint(
        "lint_tool_dependencies_actions",
        lint_tool_dependencies_actions,
        path,
    )
    lint_ctx.lint(
        "lint_repository_dependencies",
        lint_repository_dependencies,
        path,
    )
    lint_ctx.lint(
        "lint_shed_yaml",
        lint_shed_yaml,
        realized_repository,
    )
    lint_ctx.lint(
        "lint_readme",
        lint_readme,
        path,
    )
    if kwds["urls"]:
        lint_ctx.lint(
            "lint_urls",
            lint_tool_dependencies_urls,
            path,
        )
    if kwds["tools"]:
        for (tool_path, tool_source) in yield_tool_sources(ctx,
                                                           path,
                                                           recursive=True):
            info("+Linting tool %s" % tool_path)
            if handle_tool_load_error(tool_path, tool_source):
                failed = True
                continue
            lint_tool_source_with(lint_ctx,
                                  tool_source,
                                  extra_modules=lint_args["extra_modules"])
    if kwds["ensure_metadata"]:
        lint_ctx.lint(
            "lint_shed_metadata",
            lint_shed_metadata,
            realized_repository,
        )
    return handle_lint_complete(lint_ctx, lint_args, failed=failed)