Changeset View
Changeset View
Standalone View
Standalone View
swh/scanner/cli.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | |||||||||||||
@click.option( | @click.option( | ||||||||||||
"-i", "--interactive", is_flag=True, help="Show the result in a dashboard" | "-i", "--interactive", is_flag=True, help="Show the result in a dashboard" | ||||||||||||
) | ) | ||||||||||||
@click.option( | @click.option( | ||||||||||||
"-p", | "-p", | ||||||||||||
"--policy", | "--policy", | ||||||||||||
default="auto", | default="auto", | ||||||||||||
show_default=True, | show_default=True, | ||||||||||||
type=click.Choice(["auto", "bfs", "filepriority", "dirpriority"]), | type=click.Choice(["auto", "bfs", "greedybfs", "filepriority", "dirpriority"]), | ||||||||||||
help="The scan policy.", | help="The scan policy.", | ||||||||||||
) | ) | ||||||||||||
@click.pass_context | @click.pass_context | ||||||||||||
def scan(ctx, root_path, api_url, patterns, out_fmt, interactive, policy): | def scan(ctx, root_path, api_url, patterns, out_fmt, interactive, policy): | ||||||||||||
"""Scan a source code project to discover files and directories already | """Scan a source code project to discover files and directories already | ||||||||||||
present in the archive. | present in the archive. | ||||||||||||
The source code project can be checked using different policies that can be set | The source code project can be checked using different policies that can be set | ||||||||||||
using the -p/--policy option: | using the -p/--policy option: | ||||||||||||
auto: it selects the best policy based on the source code, for codebase(s) with | auto: it selects the best policy based on the source code, for codebase(s) with | ||||||||||||
less than 1000 file/dir contents all the nodes will be queried. | less than 1000 file/dir contents all the nodes will be queried. | ||||||||||||
bfs: scan the source code in the BFS order, checking unknown directories only. | bfs: scan the source code in the BFS order, checking unknown directories only. | ||||||||||||
greedybfs: same as "bfs" policy, but lookup the status of source code artifacts in | |||||||||||||
vlorentz: I find "fill" a bit unclear. Do you mean using it to the max? | |||||||||||||
Not Done Inline Actions
I agree with val, hopefully the suggestion above improved it correctly. ardumont: I agree with val, hopefully the suggestion above improved it correctly. | |||||||||||||
Not Done Inline Actionsbetter: "greedybfs: same as "bfs" policy, but lookup the status of source code artifacts in chunks, in order to minimize the number of Web API round-trips with the archive." zack: better: "greedybfs: same as "bfs" policy, but lookup the status of source code artifacts in… | |||||||||||||
chunks, in order to minimize the number of Web API round-trips with the archive. | |||||||||||||
filepriority: scan all the source code file contents, checking only unset | filepriority: scan all the source code file contents, checking only unset | ||||||||||||
directories. (useful if the codebase contains a lot of source files) | directories. (useful if the codebase contains a lot of source files) | ||||||||||||
dirpriority: scan all the source code directories and check only unknown | dirpriority: scan all the source code directories and check only unknown | ||||||||||||
directory contents. | directory contents. | ||||||||||||
""" | """ | ||||||||||||
import swh.scanner.scanner as scanner | import swh.scanner.scanner as scanner | ||||||||||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
I find "fill" a bit unclear. Do you mean using it to the max?