The branch description must be present. The description should not contain the placeholder, and should be at least 5 words long.
(pr_body)
| 330 | |
| 331 | |
| 332 | def 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 | |
| 360 | def check_ai_disclosure(pr_body): |
no test coverage detected