Skip to content

Commit 6228051

Browse files
committed
Add emoji for -hf failure with repo flag
1 parent ee07088 commit 6228051

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

good_first_issues/graphql/services.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
from requests.models import Response
2020
from requests.adapters import HTTPAdapter
2121

22-
from good_first_issues.graphql.queries import org_query, repo_query, user_query, search_query
22+
from good_first_issues.graphql.queries import (
23+
org_query,
24+
repo_query,
25+
user_query,
26+
search_query,
27+
)
2328

2429

2530
# Initializations
@@ -111,14 +116,13 @@ def extract_repo_issues(
111116

112117
return issues, rate_limit
113118

119+
114120
def extract_search_results(payload: Dict) -> Tuple[Iterable, int]:
115121
"""
116122
Extract issues based on search query.
117123
"""
118124
# Get the edges connecting to all the repositories.
119-
base_data: List = (
120-
payload["data"].get("search").get("edges")
121-
)
125+
base_data: List = payload["data"].get("search").get("edges")
122126

123127
# Extract rate limit value.
124128
rate_limit: int = payload["data"].get("rateLimit").get("remaining")
@@ -132,7 +136,10 @@ def extract_search_results(payload: Dict) -> Tuple[Iterable, int]:
132136

133137
return list(pipeline), rate_limit
134138

135-
def identify_mode(name: str, repo: str, user: bool, hacktoberfest: bool) -> Tuple[str, Dict, str]:
139+
140+
def identify_mode(
141+
name: str, repo: str, user: bool, hacktoberfest: bool
142+
) -> Tuple[str, Dict, str]:
136143
"""
137144
Identify the mode based on arguments passed.
138145
@@ -164,13 +171,16 @@ def identify_mode(name: str, repo: str, user: bool, hacktoberfest: bool) -> Tupl
164171

165172
if hacktoberfest and not repo:
166173
query = search_query
167-
variables["queryString"] = 'topic:hacktoberfest '
174+
variables["queryString"] = "topic:hacktoberfest "
168175
if name:
169-
variables["queryString"]+=f'user:{name}'
170-
mode="search"
176+
variables["queryString"] += f"user:{name}"
177+
mode = "search"
171178

172179
if repo and hacktoberfest:
173-
console.print("Error: --hacktoberfest or --hf cannot be used with --repo flag", style="bold red")
180+
console.print(
181+
"Error: --hacktoberfest or --hf cannot be used with --repo flag:x:",
182+
style="bold red",
183+
)
174184
sys.exit()
175185

176186
return query, variables, mode

0 commit comments

Comments
 (0)