-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprimeIssueDensityArgs.py
80 lines (73 loc) · 2.61 KB
/
primeIssueDensityArgs.py
1
2
3
4
5
6
7
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
from argparse import ArgumentParser, Namespace
from prime_issue_density.utils import common
version: str = "0.4.0"
def mainArgs() -> Namespace:
parser: ArgumentParser = ArgumentParser(
prog=f"{common.name} Issue Density Computer",
description="A tool to compute the Issue Density of a repository",
epilog=f"Author(s): {common.author}",
formatter_class=common.SortingHelpFormatter,
)
parser.add_argument(
"-c",
"--commits",
help=f"Commits JSON file from {common.name} Commits Extractor. DEFAULT: commits_loc.json",
default="commits_loc.json",
required=False,
type=str,
)
parser.add_argument(
"-i",
"--issues",
help=f"Issues JSON file from {common.name} Issues Downloader. DEFAULT: issues.json",
default="issues.json",
required=False,
type=str,
)
common.versionArg(parser=parser, version=version)
common.outputFileArg(
parser=parser,
helpMessage="JSON file to output Issue Density computations to. DEFAULT: issueDensity.json",
defaultFile="issueDensity.json",
)
return parser.parse_args()
def graphArgs() -> Namespace:
parser: ArgumentParser = ArgumentParser(
prog=f"{common.name} Issue Density Grapher",
description=f"A tool for graphing Issue Density information from the output of the {common.name} Issue Density Computer.",
epilog=f"Author(s): {common.author}",
formatter_class=common.SortingHelpFormatter,
)
common.inputFileArg(
parser=parser,
helpMessage=f"JSON file from {common.name} Issue Density Computer. DEFAULT: issueDensity.json",
defaultFile="issueDensity.json",
)
common.outputFileArg(
parser=parser,
helpMessage="Filename of the graph. DEFAULT: issueDensity.pdf",
defaultFile="issueDensity.pdf",
)
common.plotTypeArg(
parser=parser,
helpMessage="Type of graph to plot. DEFAULT: line",
defaultValue="line",
)
common.plotTitleArg(
parser=parser,
helpMessage='Title of the graph. DEFAULT: "Issue Density""',
defaultValue="Issue Density",
)
common.plotXLabelArg(
parser=parser,
helpMessage="Labe of the X axis of the graph. DEFAULT: Days",
defaultValue="Days",
)
common.plotYLabelArg(
parser=parser,
helpMessage='Label of the Y axis of the graph. DEFAULT: "Issue Density"',
defaultValue="Issue Density",
)
common.plotStylesheetArg(parser=parser)
common.versionArg(parser=parser, version=version)
return parser.parse_args()