mirror of
https://github.com/karma-riuk/crab.git
synced 2025-07-05 05:28:13 +02:00
wrote better code
This commit is contained in:
@ -210,16 +210,17 @@ def process_repo(
|
|||||||
prs = repo.get_pulls(state="closed")
|
prs = repo.get_pulls(state="closed")
|
||||||
|
|
||||||
n_good_prs = 0
|
n_good_prs = 0
|
||||||
with tqdm(prs, desc="Processing prs", leave=False) as pbar:
|
with tqdm(total=prs.totalCount, desc="Processing prs", leave=False) as pbar:
|
||||||
for pr in pbar:
|
for pr in prs:
|
||||||
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
|
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
|
||||||
if pr.merged_at is None:
|
if pr.merged_at is None or not is_pull_good(pr):
|
||||||
pbar.update(1)
|
pbar.update(1)
|
||||||
continue
|
continue
|
||||||
if is_pull_good(pr):
|
|
||||||
n_good_prs += 1
|
n_good_prs += 1
|
||||||
process_pull(repo, pr, dataset, repos_dir, cache)
|
process_pull(repo, pr, dataset, repos_dir, cache)
|
||||||
dataset.to_json(args.output)
|
dataset.to_json(args.output)
|
||||||
|
pbar.update(1)
|
||||||
|
|
||||||
|
|
||||||
def process_repos(
|
def process_repos(
|
||||||
|
Reference in New Issue
Block a user