You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: repair a malformed title prefix instead of prepending a second one #3578
Found by Qodo review of #3573 (merged as #3568's fix).
Problem
isAlreadyPrefixed() correctly requires whitespace after the colon — the Conventional Commits spec makes the terminal colon-and-space required, and both normalize-issue-pr-titles.cjs and .js now enforce it. But normalizeTitle() handles that rejection by prepending the prefix again, so a malformed title is mutated into a worse one:
That doubles the prefix instead of repairing it. The behaviour is pre-existing and asserted by normalize-titles.test.js (normalizeTitle("fix:Add something", "fix") === "fix: fix:Add something"), and the ecosystem norm is to detect and report a malformed header rather than silently rewrite it — commitlint fails with type-enum instead of editing.
Approach
Recognise a leading prefix independently of whether its spacing is canonical:
recognised prefix, canonical spacing -> leave the title alone
recognised prefix, missing space -> insert the single space, keeping one prefix
no recognised prefix -> prepend the inferred prefix as today
Apply to both.cjs and .js so they stay byte-identical, and update the assertion that currently encodes the doubling.
Acceptance
decision:Adopt GraphQL becomes decision: Adopt GraphQL, not decision: decision:Adopt GraphQL
Already-canonical titles are still left untouched
Unprefixed titles still gain a prefix
The CommonJS and JavaScript implementations stay byte-identical, with parity tests covering the new cases
No change to the canonical title grammar in docs/ISSUE_PR_TITLE_GOVERNANCE.md
Activity
linear-code commentedon Sep 26, 2026
GIT-2362
fix: repair a malformed title prefix instead of doubling it (#3578) (#…