The PR title must include the ticket number (e.g. #36991). This enables Trac's auto-link feature, which associates the PR with the ticket when the title follows the commit message format.
(pr_title, ticket_id)
| 319 | |
| 320 | |
| 321 | def check_pr_title_has_ticket(pr_title, ticket_id): |
| 322 | """The PR title must include the ticket number (e.g. #36991). |
| 323 | |
| 324 | This enables Trac's auto-link feature, which associates the PR with the |
| 325 | ticket when the title follows the commit message format. |
| 326 | """ |
| 327 | if re.search(rf"#{ticket_id}\b", pr_title): |
| 328 | return None |
| 329 | return Message(*MISSING_TICKET_IN_PR_TITLE, ticket_id=ticket_id) |
| 330 | |
| 331 | |
| 332 | def check_branch_description(pr_body): |