8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 | def get_parser():
parser = argparse.ArgumentParser(
prog="docstr-health",
description="Health score and visualization for Python projects.",
)
parser.add_argument(
"project_path",
type=Path,
nargs="?",
default=Path("."),
help="Path to the directory to check.",
)
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s {__version__}",
help="Show version and exit.",
)
main_group = parser.add_argument_group("basic parameters")
main_group.add_argument(
"--repo-url",
type=str,
help="Scan a project from a remote Git repository.",
)
main_group.add_argument(
"--pypi-package",
type=str,
help="Scan a project from a remote PyPi package.",
)
main_group.add_argument(
"--cache-dir",
type=Path,
default=config.get_cache_dir(),
help=f"Directory for cached repositories (default: {config.get_cache_dir()})",
)
parser.add_argument(
"--no-cache",
action="store_true",
help="Do not save cache for remote repositories.",
)
parser.add_argument(
"--compact",
action="store_true",
help="Display only general statistics, hiding the list of functions.",
)
parser.add_argument(
"--doc-modules",
action="store_true",
help="Check __doc__ of the files themselves",
)
parser.add_argument(
"--ignore-tests",
action="store_true",
help="Ignore Test Units",
)
parser.add_argument(
"--short-names",
action="store_true",
help="Replaces full path to the file with short ones",
)
parser.add_argument(
"--ci",
action="store_true",
help="CI mode suppress output, exit 1 if status ≤ failure_level",
)
measurement_group = parser.add_argument_group("parameters of methods measurement")
measurement_group.add_argument(
"--threshold-bad",
type=int,
help="",
default=config.parameters["threshold_bad"],
)
measurement_group.add_argument(
"--threshold-warning",
type=int,
help="",
default=config.parameters["threshold_warning"],
)
measurement_group.add_argument(
"--threshold-special",
type=int,
help="",
default=config.parameters["threshold_special"],
)
measurement_group.add_argument(
"--threshold-epic",
type=int,
help="",
default=config.parameters["threshold_epic"],
)
# measurement_group.add_argument(
# "--allow-failure",
# type=str,
# help="",
# default=config.parameters["threshold_epic"],
# )
# parser.add_argument(
# "--details-skipped",
# )
return parser
|