Skip to content

Commit 3d81ec5

Browse files
committed
Implement script to create GitHub issues
1 parent 0ef7d4f commit 3d81ec5

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

scripts/create_issues.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Script to create issue for every unsupported command.
3+
"""
4+
5+
from supported import get_unimplemented_and_implemented_commands, download_redis_commands
6+
7+
8+
def print_gh_commands(commands: dict, unimplemented: dict):
9+
for group in unimplemented:
10+
print(f'### Creating issues for {group} commands')
11+
for item in unimplemented[group]:
12+
cmd = item.upper()
13+
link = f"https://redis.io/commands/{item.replace(' ', '-')}/"
14+
summary = commands[item]['summary']
15+
title = f"Implement support for \`{cmd}\` ({group} command)"
16+
body = f"Implement support for command \`{cmd}\` ([documentation]({link})). {summary}"
17+
print(f'gh issue create --title "{title}" --body "{body}" --label "enhancement,help wanted"')
18+
19+
20+
if __name__ == '__main__':
21+
commands = download_redis_commands()
22+
unimplemented_dict, _ = get_unimplemented_and_implemented_commands()
23+
print_gh_commands(commands, unimplemented_dict)

scripts/supported.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def commands_groups(
4646
return implemented, unimplemented
4747

4848

49-
def print_unimplemented_commands(all_commands: dict, implemented: dict, unimplemented: dict) -> None:
49+
def print_unimplemented_commands(
50+
all_commands: dict,
51+
unimplemented: dict,
52+
implemented: dict) -> None:
5053
def print_groups(dictionary: dict):
5154
for group in dictionary:
5255
print(f'### {group}')
@@ -68,8 +71,17 @@ def print_groups(dictionary: dict):
6871
print_groups(unimplemented)
6972

7073

71-
if __name__ == '__main__':
74+
def get_unimplemented_and_implemented_commands() -> tuple[dict[str, list[str]], dict[str, list[str]]]:
75+
"""Returns 2 dictionaries, one of unimplemented commands and another of implemented commands
76+
77+
"""
7278
commands = download_redis_commands()
7379
implemented_commands_set = implemented_commands()
74-
unimplemented_dict, implemented_dict = commands_groups(commands, implemented_commands_set)
80+
implemented_dict, unimplemented_dict = commands_groups(commands, implemented_commands_set)
81+
return unimplemented_dict, implemented_dict
82+
83+
84+
if __name__ == '__main__':
85+
commands = download_redis_commands()
86+
unimplemented_dict, implemented_dict = get_unimplemented_and_implemented_commands()
7587
print_unimplemented_commands(commands, unimplemented_dict, implemented_dict)

0 commit comments

Comments
 (0)