MCPcopy
hub / github.com/django/django / check_pr_title_has_ticket

Function check_pr_title_has_ticket

scripts/pr_quality/check_pr.py:321–329  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

319
320
321def 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
332def check_branch_description(pr_body):

Callers 1

mainFunction · 0.85

Calls 2

MessageClass · 0.90
searchMethod · 0.80

Tested by

no test coverage detected