(body: str)
| 33 | |
| 34 | |
| 35 | def find_reviewers(body: str) -> list[str]: |
| 36 | print(f"Parsing body:\n{body}") |
| 37 | matches = re.findall(r"(cc( @[-A-Za-z0-9]+)+)", body, flags=re.MULTILINE) |
| 38 | matches = [full for full, last in matches] |
| 39 | |
| 40 | print("Found matches:", matches) |
| 41 | reviewers = [] |
| 42 | for match in matches: |
| 43 | if match.startswith("cc "): |
| 44 | match = match.replace("cc ", "") |
| 45 | users = [x.strip() for x in match.split("@")] |
| 46 | reviewers += users |
| 47 | |
| 48 | reviewers = set(x for x in reviewers if x != "") |
| 49 | return sorted(list(reviewers)) |
| 50 | |
| 51 | |
| 52 | if __name__ == "__main__": |
no test coverage detected
searching dependent graphs…