(s: str, github_url: str)
| 41 | |
| 42 | @staticmethod |
| 43 | def search(s: str, github_url: str) -> Optional["PullRequestResolved"]: |
| 44 | m = re_pull_request_resolved(github_url).search(s) |
| 45 | if m is not None: |
| 46 | return PullRequestResolved( |
| 47 | owner=m.group("owner"), |
| 48 | repo=m.group("repo"), |
| 49 | number=GitHubNumber(int(m.group("number"))), |
| 50 | github_url=github_url, |
| 51 | ) |
| 52 | m = RE_GH_METADATA.search(s) |
| 53 | if m is not None: |
| 54 | return PullRequestResolved( |
| 55 | owner=m.group("owner"), |
| 56 | repo=m.group("repo"), |
| 57 | number=GitHubNumber(int(m.group("number"))), |
| 58 | github_url=github_url, |
| 59 | ) |
| 60 | return None |
| 61 | |
| 62 | |
| 63 | @dataclass |
no test coverage detected