Something went wrong. Try again.
finally, the solution to your team's AI review bottleneck
Something went wrong. Try again.
12345678910111213141516171819202122232425262728// Runnable check for the commit-mention splitter (no framework, no deps; Node// strips the types): `node src/lib/commit.check.ts`.import { splitCommitMention } from "./commit.ts";
function eq(actual: unknown, expected: unknown, label: string): void { const a = JSON.stringify(actual); const e = JSON.stringify(expected); if (a !== e) throw new Error(`commit.check failed — ${label}\n expected ${e}\n got ${a}`);}
// pushed event: the short hash becomes its own (clickable) segmenteq(splitCommitMention("pushed abc1234", "abc1234def5567"), { before: "pushed ", short: "abc1234", after: "" }, "pushed");
// merged event: text on both sides of the hash is preservedeq( splitCommitMention("merged this PR as 0011223 cleanly", "0011223aa"), { before: "merged this PR as ", short: "0011223", after: " cleanly" }, "merged");
// no sha (e.g. "closed this PR") → nothing to linkeq(splitCommitMention("closed this PR", undefined), null, "no sha");
// defensive: a sha that isn't actually in the sentence → nothing to linkeq(splitCommitMention("reopened this PR", "deadbeef0"), null, "absent sha");
console.log("commit.check: all assertions passed");