Skip to content

Commit 3978a78

Browse files
style: format code with Black, isort, Prettier and Ruff Formatter (#170)
This commit fixes the style issues introduced in c3ec67b according to the output from Black, isort, Prettier and Ruff Formatter. Details: None Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
1 parent c3ec67b commit 3978a78

2 files changed

Lines changed: 408 additions & 298 deletions

File tree

fetch.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
# TARGET_USERS = 20
2626
MAX_EXTRA_PAGES = 2
2727

28-
WEEK_SECONDS = 7 * 24 * 60 * 60 # for trending feature
28+
WEEK_SECONDS = 7 * 24 * 60 * 60 # for trending feature
29+
2930

3031
def load_previous_users(path: str = "./docs/users.json") -> Dict[str, Dict[str, Any]]:
3132
"""Load previous user data from a JSON file and index it by login.
@@ -230,7 +231,10 @@ def fetch_user_detail_with_retry(login: str, max_retries: int = 5) -> Dict[str,
230231
logger.warning("Failed to fetch %s after %d attempts", login, max_retries)
231232
return {}
232233

233-
def compute_follower_growth(login: str, current_followers: Any, previous_users: Dict[str, Dict[str, Any]]) -> Dict[str, Any]:
234+
235+
def compute_follower_growth(
236+
login: str, current_followers: Any, previous_users: Dict[str, Dict[str, Any]]
237+
) -> Dict[str, Any]:
234238
"""
235239
Trending feature: compute follower growth data, including snapshot timestamp.
236240
"""
@@ -271,7 +275,12 @@ def compute_follower_growth(login: str, current_followers: Any, previous_users:
271275
}
272276

273277

274-
def enrich_user_with_details(user: Dict[str, Any], idx: int, total: int, previous_users: Dict[str, Dict[str, Any]]) -> None:
278+
def enrich_user_with_details(
279+
user: Dict[str, Any],
280+
idx: int,
281+
total: int,
282+
previous_users: Dict[str, Dict[str, Any]],
283+
) -> None:
275284
"""Add detailed information (followers, repos, sponsors) to user dict."""
276285
detail = fetch_user_detail_with_retry(user["login"])
277286
if not detail:
@@ -314,7 +323,9 @@ def enrich_user_with_details(user: Dict[str, Any], idx: int, total: int, previou
314323
time.sleep(0.15)
315324

316325

317-
def enrich_all_users(users: List[Dict[str, Any]], previous_users: Dict[str, Dict[str, Any]]) -> None:
326+
def enrich_all_users(
327+
users: List[Dict[str, Any]], previous_users: Dict[str, Dict[str, Any]]
328+
) -> None:
318329
"""Enrich all users with detailed information from GitHub API."""
319330
total = len(users)
320331
for idx, user in enumerate(users, 1):
@@ -566,7 +577,7 @@ def run() -> None:
566577
logger.info("Target users: %d", TARGET_USERS)
567578
logger.info("")
568579

569-
previous_users = load_previous_users() # for trending feature
580+
previous_users = load_previous_users() # for trending feature
570581

571582
users = fetch_users_from_search(TARGET_USERS)
572583

0 commit comments

Comments
 (0)