Skip to content

Commit 8e34aff

Browse files
committed
fix: from review
1 parent 936d7f7 commit 8e34aff

1 file changed

Lines changed: 45 additions & 49 deletions

File tree

.coderabbit.yaml

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .coderabbit.yaml for a Next.js project
1+
# .coderabbit.yaml for Open Source Bazaar 项目
22

33
# -----------------
44
# 核心设置
@@ -7,50 +7,52 @@
77
# 设置 CodeRabbit 回复的语言 (e.g., "en", "zh-CN")
88
language: "zh-CN"
99

10-
# .coderabbit.yaml for Open Source Bazaar 项目
11-
12-
# -----------------
13-
# 核心设置
14-
# -----------------
15-
16-
# -----------------
17-
# 内容过滤 (Next.js 项目关键)
18-
# -----------------
19-
20-
# 排除 Next.js 项目中不需要审查的文件和目录
21-
exclude:
22-
# 这是最重要的排除项!'.next' 目录包含了所有的构建输出、开发缓存和服务端代码。
23-
- ".next/**"
24-
25-
# Node_js 依赖
26-
- "node_modules/**"
27-
28-
# public 目录通常存放静态资源(图片、字体等),一般不需要代码审查。
29-
- "public/**"
30-
31-
# next export 的输出目录
32-
- "out/**"
33-
34-
# 自动生成的 TypeScript 类型定义文件
35-
- "next-env.d.ts"
36-
37-
# 依赖锁定文件
38-
- "package-lock.json"
39-
- "pnpm-lock.yaml"
40-
- "yarn.lock"
41-
42-
# 测试快照
43-
- "**/__snapshots__/**"
44-
45-
# 文档文件
46-
- "**/*.md"
47-
4810
# -----------------
49-
# 审查定制 (为 Next.js 优化的指令)
11+
# 审查配置
5012
# -----------------
5113

52-
# 这是配置的核心部分!我们为 AI 提供针对 Open Source Bazaar 项目的审查指令。
53-
extra_instructions: |
14+
reviews:
15+
# 高级摘要配置
16+
high_level_summary: true
17+
high_level_summary_placeholder: "这是 Open Source Bazaar 项目的 PR 变更摘要"
18+
19+
# 路径过滤 - 排除 Next.js 项目中不需要审查的文件和目录
20+
path_filters:
21+
- "src/**"
22+
- "pages/**"
23+
- "components/**"
24+
- "models/**"
25+
- "!**/*.md"
26+
- "!**/*.{bin,csv}"
27+
- "!node_modules/**"
28+
- "!.next/**"
29+
- "!public/**"
30+
- "!out/**"
31+
- "!next-env.d.ts"
32+
- "!package-lock.json"
33+
- "!pnpm-lock.yaml"
34+
- "!yarn.lock"
35+
- "!**/__snapshots__/**"
36+
37+
# 代码生成指令
38+
code_generation:
39+
docstrings:
40+
path_instructions:
41+
"pages/**": "确保所有用户界面文本使用 t() 函数进行国际化翻译"
42+
"components/**": "必须使用 React Bootstrap 组件替代自定义 HTML 元素"
43+
"models/**": "检查 MobX store 的正确使用,包括 @observer、@observable、@action、@computed"
44+
45+
# 工具配置
46+
tools:
47+
typescript:
48+
enabled: true
49+
config: "tsconfig.json"
50+
eslint:
51+
enabled: true
52+
config: "eslint.config.ts"
53+
54+
# 全局语气指令
55+
tone_instructions: |
5456
这是一个基于 Next.js 15 (Pages Router) + TypeScript + MobX + React Bootstrap 的项目。请像一位资深的开发者一样进行审查,并严格遵循以下规则:
5557
5658
1. **React Bootstrap 组件使用**:
@@ -61,7 +63,7 @@ extra_instructions: |
6163
6264
2. **MobX 状态管理**:
6365
- 检查 MobX store 的正确使用,包括 `@observer` 装饰器
64-
- 确保 `@observable`、`@action`、`@computed` 的正确使用
66+
- 确保 `@observable`、`@action`、@computed` 的正确使用
6567
- 验证组件正确连接到 MobX store
6668
6769
3. **国际化 (i18n) 要求**:
@@ -93,9 +95,3 @@ extra_instructions: |
9395
- 遵循现有的项目结构
9496
- 使用现有的工具库(如 `web-utility`)
9597
- 保持代码的可读性和模块化
96-
97-
# PR 的变更行数上限。如果超过,则跳过审查。
98-
line_limit: 1000
99-
100-
# PR 变更总结的类型
101-
summarize: "default"

0 commit comments

Comments
 (0)