Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ conf/.env
__pycache__/
.cursorignore
.cursor

.claude/
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## 功能

- 🚀 多模型支持
- 兼容 DeepSeek、ZhipuAI、OpenAI、通义千问 和 Ollama,想用哪个就用哪个。
- 兼容 DeepSeek、ZhipuAI、OpenAI、通义千问、OllamaClaude Code,想用哪个就用哪个。
- 📢 消息即时推送
- 审查结果一键直达 钉钉、企业微信 或 飞书,代码问题无处可藏!
- 📅 自动化日报生成
Expand Down Expand Up @@ -56,12 +56,17 @@ cp conf/.env.dist conf/.env
- 编辑 conf/.env 文件,配置以下关键参数:

```bash
#大模型供应商配置,支持 zhipuai , openai , deepseek 和 ollama
#大模型供应商配置,支持 zhipuai, openai, deepseek, ollama 和 claudecode
LLM_PROVIDER=deepseek

#DeepSeek
DEEPSEEK_API_KEY={YOUR_DEEPSEEK_API_KEY}

#Claude Code (需要先安装 CLI: npm install -g @anthropic-ai/claude-code)
#CLAUDE_CODE_API_KEY={YOUR_ANTHROPIC_API_KEY}
#CLAUDE_CODE_API_BASE_URL=https://api.anthropic.com
#CLAUDE_CODE_API_MODEL=sonnet

#支持review的文件类型(未配置的文件类型不会被审查)
SUPPORTED_EXTENSIONS=.java,.py,.php,.yml,.vue,.go,.c,.cpp,.h,.js,.css,.md,.sql

Expand Down
6 changes: 5 additions & 1 deletion biz/gitlab/webhook_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ def filter_changes(changes: list):

filter_deleted_files_changes = [change for change in changes if not change.get("deleted_file")]

# 过滤 `new_path` 以支持的扩展名结尾的元素, 仅保留diff和new_path字段
# 过滤 `new_path` 以支持的扩展名结尾的元素, 保留必要的字段信息
filtered_changes = [
{
'diff': item.get('diff', ''),
'new_path': item['new_path'],
'old_path': item.get('old_path', ''),
'new_file': item.get('new_file', False),
'renamed_file': item.get('renamed_file', False),
'deleted_file': item.get('deleted_file', False),
'additions': len(re.findall(r'^\+(?!\+\+)', item.get('diff', ''), re.MULTILINE)),
'deletions': len(re.findall(r'^-(?!--)', item.get('diff', ''), re.MULTILINE))
}
Expand Down
Loading