Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acb3604cda | |||
| 38a3349e4f | |||
| 4e586158a5 |
@@ -5,5 +5,19 @@
|
||||
"location": "action.yaml:18",
|
||||
"suggestion": "引入 GITEA_COMMENT_TOKEN 是一個很好的實踐,遵循最小權限原則。請確保為此 token 配置的權限確實僅限於發布評論。同時,與 GITEA_TOKEN 類似,建議使用者始終從 workflow 的 secrets context 傳遞此 token,以避免硬編碼敏感資料。",
|
||||
"is_new": false
|
||||
},
|
||||
{
|
||||
"level": "info",
|
||||
"role": "Leo",
|
||||
"location": "app/log.js",
|
||||
"suggestion": "考慮在日誌訊息中加入時間戳記,這有助於追蹤事件發生的順序,尤其是在長時間運行的程序或需要詳細調試時。可以在每個日誌函式內部自動添加時間戳記。",
|
||||
"is_new": false
|
||||
},
|
||||
{
|
||||
"level": "info",
|
||||
"role": "Leo",
|
||||
"location": "app/log.js:19",
|
||||
"suggestion": "在 `warn` 函式中使用 `console.warn` 而非 `console.log`。雖然目前功能相同,但 `console.warn` 在某些環境下(例如瀏覽器開發者工具)會以不同的樣式呈現警告訊息,有助於區分不同嚴重程度的日誌。",
|
||||
"is_new": false
|
||||
}
|
||||
]
|
||||
|
||||
+2
-4
@@ -76,7 +76,7 @@ async function main() {
|
||||
}
|
||||
ok(`Step2 完成: 新 findings 總計 ${newFindings.length} 筆`);
|
||||
|
||||
step('Step3', 'Findings 合併');
|
||||
step('Step3', 'Findings 合併與語意去重');
|
||||
let repoDir;
|
||||
try {
|
||||
repoDir = cloneRepo(WORKSPACE);
|
||||
@@ -90,11 +90,9 @@ async function main() {
|
||||
const oldFindings = loadOldFindings(repoDir || WORKSPACE);
|
||||
const mergedFindings = mergeFindings(oldFindings, newFindings);
|
||||
ok(`Step3 merged findings total=${mergedFindings.length}`);
|
||||
|
||||
step('Step3b', 'AI 語意去重');
|
||||
const deduped = await deduplicateWithAI(mergedFindings);
|
||||
const sorted = sortByLevel(deduped);
|
||||
ok(`Step3b dedup findings total=${sorted.length} (critical=${sorted.filter(f=>f.level==='critical').length} warning=${sorted.filter(f=>f.level==='warning').length} info=${sorted.filter(f=>f.level==='info').length})`);
|
||||
ok(`Step3 去重完成: ${mergedFindings.length} -> ${sorted.length} 筆 (critical=${sorted.filter(f=>f.level==='critical').length} warning=${sorted.filter(f=>f.level==='warning').length} info=${sorted.filter(f=>f.level==='info').length})`);
|
||||
|
||||
step('Step4', 'AI 排除問題過濾');
|
||||
const exclusions = loadExclusions(repoDir || WORKSPACE, repoState);
|
||||
|
||||
Reference in New Issue
Block a user