diff --git a/src/hooks/comment-checker/cli-runner.ts b/src/hooks/comment-checker/cli-runner.ts index 42cc19232..00f5a0411 100644 --- a/src/hooks/comment-checker/cli-runner.ts +++ b/src/hooks/comment-checker/cli-runner.ts @@ -47,6 +47,9 @@ export async function processWithCli( cliPath: string, customPrompt: string | undefined, debugLog: (...args: unknown[]) => void, + deps: { + runCommentChecker?: typeof runCommentChecker + } = {}, ): Promise { await withCommentCheckerLock(async () => { void input @@ -67,7 +70,7 @@ export async function processWithCli( }, } - const result = await runCommentChecker(hookInput, cliPath, customPrompt) + const result = await (deps.runCommentChecker ?? runCommentChecker)(hookInput, cliPath, customPrompt) if (result.hasComments && result.message) { debugLog("CLI detected comments, appending message")