Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/planemo/commands/cmd_shed_lint.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 """Module describing the planemo ``shed_lint`` command.""" | |
2 import click | |
3 | |
4 from planemo import options | |
5 from planemo import shed | |
6 from planemo import shed_lint | |
7 from planemo.cli import command_function | |
8 | |
9 | |
10 @click.command('shed_lint') | |
11 @options.shed_realization_options() | |
12 @options.report_level_option() | |
13 @options.fail_level_option() | |
14 @options.click.option( | |
15 '--tools', | |
16 is_flag=True, | |
17 default=False, | |
18 help=("Lint tools discovered in the process of linting repositories.") | |
19 ) | |
20 @options.lint_xsd_option() | |
21 @options.click.option( | |
22 '--ensure_metadata', | |
23 is_flag=True, | |
24 default=False, | |
25 help=("Ensure .shed.yml files contain enough metadata for each repository " | |
26 "to allow automated creation and/or updates.") | |
27 ) | |
28 @click.option( | |
29 "--urls", | |
30 is_flag=True, | |
31 default=False, | |
32 help="Check validity of URLs in XML files", | |
33 ) | |
34 # @click.option( | |
35 # "--verify", | |
36 # is_flag=True, | |
37 # help="If an sha256sum is available, download the entire file AND validate it.", | |
38 # default=False, | |
39 # ) | |
40 @command_function | |
41 def cli(ctx, paths, **kwds): | |
42 """Check Tool Shed repository for common issues. | |
43 | |
44 With the ``--tools`` flag, this command lints actual Galaxy tools | |
45 in addition to tool shed artifacts. | |
46 | |
47 With the ``--urls`` flag, this command searches for | |
48 ``<package>$URL</package>`` and download actions which specify URLs. Each | |
49 of those are accessed individually. By default, this tool requests the | |
50 first hundred or so bytes of each listed URL and validates that a 200 OK | |
51 was received. In tool XML files, the ``--urls`` option checks through the | |
52 help text for mentioned URLs and checks those. | |
53 """ | |
54 def lint(realized_repository): | |
55 return shed_lint.lint_repository(ctx, realized_repository, **kwds) | |
56 | |
57 kwds["fail_on_missing"] = False | |
58 exit_code = shed.for_each_repository(ctx, lint, paths, **kwds) | |
59 ctx.exit(exit_code) |