Skip to content

Commit c75fc92

Browse files
authored
Merge pull request #14 from 5an7y/sample-based-issue-template
Sort the area in the issue template
2 parents 4525b22 + 1cef4c5 commit c75fc92

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/ISSUE_TEMPLATE/sample_issue_generator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
lines = file.readlines()
77

88
# Parse the CODEOWNERS file to extract areas and their paths
9-
areas = {}
9+
areas = []
1010
sample_section_found = False
1111

1212
for line in lines:
@@ -22,7 +22,11 @@
2222
path, codeowner = line.split()
2323
if path in areas:
2424
raise ValueError(f"Path:{path} has been found two times inside CODEOWNERS file")
25-
areas[path] = codeowner
25+
areas.append(path)
26+
27+
28+
# Sort the areas in lexicographical order
29+
areas = sorted(areas)
2630

2731
# Generate the YAML structure
2832
yaml_form = {
@@ -38,7 +42,7 @@
3842
"attributes": {
3943
"label": "Which is the area where the sample lives?",
4044
"description": "Select the area where you're experiencing the problem.",
41-
"options": [path for path, codeowner in areas.items()]
45+
"options": areas
4246
},
4347
"validations": {
4448
"required": True

0 commit comments

Comments
 (0)