Mercurial > repos > shellac > guppy_basecaller
diff env/lib/python3.7/site-packages/planemo/commands/cmd_lint.py @ 2:6af9afd405e9 draft
"planemo upload commit 0a63dd5f4d38a1f6944587f52a8cd79874177fc1"
author | shellac |
---|---|
date | Thu, 14 May 2020 14:56:58 -0400 |
parents | 26e78fe6e8c4 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/lib/python3.7/site-packages/planemo/commands/cmd_lint.py Thu May 14 14:56:58 2020 -0400 @@ -0,0 +1,68 @@ +"""Module describing the planemo ``lint`` command.""" +import click + +from planemo import options +from planemo.cli import command_function +from planemo.lint import build_lint_args +from planemo.tool_lint import lint_tools_on_path + + +@click.command('lint') +@options.optional_tools_arg(multiple=True, allow_uris=True) +@options.report_level_option() +@options.report_xunit() +@options.fail_level_option() +@options.skip_option() +@options.lint_xsd_option() +@options.recursive_option() +@click.option( + "--urls", + is_flag=True, + default=False, + help="Check validity of URLs in XML files", +) +@click.option( + "--doi", + is_flag=True, + default=False, + help="Check validity of DOIs in XML files", +) +@click.option( + "--conda_requirements", + is_flag=True, + default=False, + help="Check tool requirements for availability in best practice Conda channels.", +) +@click.option( + "biocontainer", + "--biocontainer", + "--biocontainers", + is_flag=True, + default=False, + help="Check best practice BioContainer namespaces for a container definition applicable for this tool.", +) +# @click.option( +# "--verify", +# is_flag=True, +# help="If an sha256sum is available, download the entire file AND validate it.", +# default=False, +# ) +@command_function +def cli(ctx, uris, **kwds): + """Check for common errors and best practices.""" + lint_args = build_lint_args(ctx, **kwds) + exit_code = lint_tools_on_path( + ctx, + uris, + lint_args, + recursive=kwds["recursive"] + ) + + # TODO: rearchitect XUnit. + # if kwds['urls']: + # collected_data, url_exit_code = check_urls(ctx, paths, **kwds) + # if kwds.get('report_xunit', False): + # with open(kwds['report_xunit'], 'w') as handle: + # handle.write(build_report.template_data( + # collected_data, template_name='xunit.tpl')) + ctx.exit(exit_code)