Skip to content

Commit 2ffc687

Browse files
Update scripts/update_top_ranking_issues.py
Co-authored-by: Echedey Luis <[email protected]>
1 parent 568ac34 commit 2ffc687

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scripts/update_top_ranking_issues.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,22 @@ def main():
4040

4141
# Format markdown
4242
ranked_issues = []
43-
for (i, issue) in zip(range(MAX_ISSUES), issues):
44-
45-
# Don't include the overview card
43+
# Continuous number generator for the numbered list, starts at 1
44+
index_generator = itertools.count(1)
45+
for issue in issues:
46+
# Don't include the overview card (skip to next iteration)
4647
if issue.number == TOP_ISSUES_CARD_NUMBER:
47-
pass
48+
continue
49+
50+
# Get numbered list item index from generator
51+
i = next(index_generator)
4852

4953
markdown_bullet_point: str = (
5054
f"{issue.html_url} " +
5155
f"({issue._rawData['reactions']['+1']} :thumbsup:)"
5256
)
5357

54-
markdown_bullet_point = f"{i + 1}. {markdown_bullet_point}"
58+
markdown_bullet_point = f"{i}. {markdown_bullet_point}"
5559
ranked_issues.append(markdown_bullet_point)
5660

5761
# edit top issues

0 commit comments

Comments
 (0)