INNER CODE UNIT · Python
label
futo-org/android-keyboard · tools/contributors.py:30
label: str | None = None) -> Set[str]:
"""Return the *login* of everyone whose PR is merged. If `label` is given then only looks for the label."""
url = f"{GH_API}/repos/{owner_repo}/pulls"
prs = fetch_all(url, {"state": "closed"})
authors: Set[str] = set()
for pr in prs:
if label is None and pr.get("merged_at") is None:
continue
if label and all(l["name"] != label for l in pr.get("labels", [])):
continue
authors.add(pr["user"]["login"])
return authors
def translation_contribs(repo_dir: Path) -> Dict[str, Set[str]]:
"""
Extract mapping {name -> {languages}} from 'Co-authored-by' lines.
Expected pattern:
Co-authored-by: Alice Example <alice@dom.tld> (lt, ru)