-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
update-issue-templates
executable file
·59 lines (54 loc) · 1.38 KB
/
update-issue-templates
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
#!/usr/bin/env python
# Copyright © Michal Čihař <[email protected]>
#
# SPDX-License-Identifier: CC0-1.0
"""Generate issue templates from snippets."""
FILES = {
"bug_report.yml": (
"head",
"bug_report",
"commercial",
"describe-issue",
"tried",
"reproduce",
"expected",
"screenshots",
"exception",
"additional",
),
"bug_report.weblate.yml": (
"head",
"bug_report",
"commercial",
"describe-issue",
"tried",
"reproduce",
"expected",
"screenshots",
"exception",
"weblate-versions",
"weblate-checks",
"additional",
),
"feature_request.yml": (
"head",
"feature_request",
"commercial",
"feature-describe",
"feature-solution",
"feature-alternatives",
"screenshots",
"additional",
),
}
SNIPPETS = {}
for snippets in FILES.values():
for snippet in snippets:
if snippet not in SNIPPETS:
filename = f".github/ISSUE_TEMPLATE/snippets/{snippet}.yml"
with open(filename) as handle:
SNIPPETS[snippet] = handle.read()
for filename, snippets in FILES.items():
with open(f".github/ISSUE_TEMPLATE/{filename}", "w") as handle:
for snippet in snippets:
handle.write(SNIPPETS[snippet])