MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / parseConventionalCommit

Function parseConventionalCommit

packages/bumpy/src/commands/generate.ts:231–247  ·  view source on GitHub ↗

Parse a commit subject into conventional commit format

(commit: { hash: string; subject: string; body: string })

Source from the content-addressed store, hash-verified

229 }
230 return commits;
231}
232
233/** Parse a commit subject into conventional commit format */
234function parseConventionalCommit(commit: { hash: string; subject: string; body: string }): ConventionalCommit | null {
235 // Match: type(scope)!: description OR type!(scope): description OR type!: description
236 const match = commit.subject.match(/^(\w+)(!)?(?:\(([^)]+)\))?(!)?\s*:\s*(.+)$/);
237 if (!match) return null;
238
239 const [, type, bang1, scope, bang2, description] = match;
240 const breaking = !!bang1 || !!bang2 || commit.body.includes('BREAKING CHANGE');
241
242 return {
243 hash: commit.hash,
244 type: type!.toLowerCase(),
245 scope: scope || null,
246 breaking,
247 description: description!.trim(),
248 body: commit.body,
249 };
250}

Callers 1

generateCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…