From 11a9db798678ea6380b9bd1a6cf2ef63ad3ba5f2 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 3 Jul 2026 17:02:18 +0545 Subject: [PATCH] feat(devgen): extend header regex to include deps and wip scopes and ignore markdown fences Prevent false positives on markdown fences and enable parsing of dependency-related commit types. --- devgen/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devgen/utils.py b/devgen/utils.py index b3e4ca7..bcc9f09 100644 --- a/devgen/utils.py +++ b/devgen/utils.py @@ -46,7 +46,7 @@ def sanitize_ai_commit_message(raw_text: str) -> str: # - **fix: bug fix** # - chore(deps)!: breaking change header_pattern = re.compile( - r"^(\*\*)?(feat|fix|chore|refactor|docs|style|test|build|ci|perf|revert)(\(.*\))?!?: .*", + r"^(\*\*)?(feat|fix|chore|refactor|docs|style|test|build|ci|perf|revert|deps|wip)(\(.*\))?!?: .*", re.IGNORECASE, ) @@ -75,6 +75,9 @@ def sanitize_ai_commit_message(raw_text: str) -> str: # If we hit another header or a known separator, we stop if "**Sponsor**" in line: break + # Ignore trailing markdown code block markers + if line.strip() in ("```", "```md", "```markdown"): + continue cleaned_lines.append(line) if cleaned_lines: