MCPcopy
hub / github.com/django/django / check_branch_description

Function check_branch_description

scripts/pr_quality/check_pr.py:332–357  ·  view source on GitHub ↗

The branch description must be present. The description should not contain the placeholder, and should be at least 5 words long.

(pr_body)

Source from the content-addressed store, hash-verified

330
331
332def check_branch_description(pr_body):
333 """The branch description must be present.
334
335 The description should not contain the placeholder, and should be at least
336 5 words long.
337 """
338 placeholder = (
339 "Provide a concise overview of the issue or rationale behind the"
340 " proposed changes."
341 )
342
343 description_match = re.search(
344 r"#### Branch description[ \t]*\r?\n(.*?)(?=\r?\n####|\Z)",
345 pr_body,
346 re.DOTALL,
347 )
348 if not description_match:
349 return Message(*MISSING_DESCRIPTION)
350
351 # Strip HTML comments before evaluating content.
352 cleaned = strip_html_comments(description_match.group(1)).strip()
353
354 if not cleaned or placeholder in cleaned or len(cleaned.split()) < MIN_WORDS:
355 return Message(*MISSING_DESCRIPTION)
356
357 return None
358
359
360def check_ai_disclosure(pr_body):

Callers 1

mainFunction · 0.85

Calls 4

MessageClass · 0.90
strip_html_commentsFunction · 0.85
searchMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected