From cc9c8afed758ec9e0c4c7d903d9580cbeae96ed8 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 20 Jul 2026 18:04:23 +0800 Subject: [PATCH] =?UTF-8?q?docs(ai-review):=20=E5=90=8C=E6=AD=A5=20JSDoc?= =?UTF-8?q?=20=E5=B0=8D=20main()=20=E9=96=89=E5=8C=85=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配合 postComment/ensureIssueCreated 改名,更新 gitea.js 與 templates.js JSDoc 內對兩個閉包的引用名稱。 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/lib/gitea.js | 4 ++-- src/lib/templates.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/gitea.js b/src/lib/gitea.js index ab4ed6b..d99e4ce 100644 --- a/src/lib/gitea.js +++ b/src/lib/gitea.js @@ -119,7 +119,7 @@ function createCommentOnIssue(ctx, issueNumber, body) { * 依 Gitea API 回應而定)。 * @throws {Error} 請求失敗(非 2xx)由底層 `api` 丟出,錯誤附 `status`、`data`。 * @remarks 使用情境:AI review 各步驟把審查摘要、角色登場、問題彙整等內容 - * 以一般留言形式張貼到本次 PR 上(`main()` 的 `postComment` 閉包即以本函式實作)。 + * 以一般留言形式張貼到本次 PR 上(`main()` 的 `queueOrPostComment` 閉包即以本函式實作)。 */ function createIssueComment(ctx, body) { return createCommentOnIssue(ctx, ctx.prNumber, body); @@ -156,7 +156,7 @@ function listLabels(ctx) { * @returns {Promise} 建立成功的 issue 物件(含 `number`、`title`、 * `html_url` 等欄位,依 Gitea API 回應而定)。 * @throws {Error} 請求失敗(非 2xx)由底層 `api` 丟出,錯誤附 `status`、`data`。 - * @remarks 使用情境:建問題模式(input: create-issue)下,`main()` 的 `ensureIssueCreated` + * @remarks 使用情境:建問題模式(input: create-issue)下,`main()` 的 `createIssueAndFlushBufferedComments` * 以 PR 標題/描述為 issue 標題與本文,並帶入 `review.selectLabels` 事先挑好的標籤 id * 呼叫本函式一次建立追蹤問題的 issue(連同標籤),之後再把審查內容逐條留言到該 issue。 */ diff --git a/src/lib/templates.js b/src/lib/templates.js index 3476aa8..f02e30b 100644 --- a/src/lib/templates.js +++ b/src/lib/templates.js @@ -302,7 +302,7 @@ function othersComment(findings) { * @param {string} [params.prBody] - PR 描述原文;nullish 或 trim 後為空時輸出佔位文字。 * @returns {string} 完整 issue 本文 Markdown 字串(含 MARK 隱藏標記)。 * @remarks - * 使用情境:建問題模式下 `main()`(src/index.js)的 `ensureIssueCreated` 建立 issue 時, + * 使用情境:建問題模式下 `main()`(src/index.js)的 `createIssueAndFlushBufferedComments` 建立 issue 時, * 以「標題=PR 標題、本文=本函式輸出」呼叫 `gitea.createIssue`, * 讓 issue 讀者能從本文回溯到觸發審查的 PR,再從下方留言逐條查看問題明細。 */