generated from idea2app/Next-Bootstrap-ts
-
Notifications
You must be signed in to change notification settings - Fork 6
CI: coderabbit review config #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f757d2d
CI: coderabbit review config
luojiyin1987 be7cdb9
CI: coderabbit review config
luojiyin1987 936d7f7
fix: typo
luojiyin1987 8e34aff
fix: from review
luojiyin1987 e387d22
fix: from review
luojiyin1987 3724b0b
fix: from review
luojiyin1987 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
language: "zh-CN" | ||
|
||
# .coderabbit.yaml for Open Source Bazaar 项目 | ||
|
||
# ----------------- | ||
# 核心设置 | ||
# ----------------- | ||
|
||
# ----------------- | ||
# 内容过滤 (Next.js 项目关键) | ||
# ----------------- | ||
|
||
# 排除 Next.js 项目中不需要审查的文件和目录 | ||
exclude: | ||
# 这是最重要的排除项!'.next' 目录包含了所有的构建输出、开发缓存和服务端代码。 | ||
- ".next/**" | ||
|
||
# node_js 依赖 | ||
- "node_modules/**" | ||
|
||
# public 目录通常存放静态资源(图片、字体等),一般不需要代码审查。 | ||
- "public/**" | ||
luojiyin1987 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
# next export 的输出目录 | ||
- "out/**" | ||
|
||
# 自动生成的 TypeScript 类型定义文件 | ||
- "next-env.d.ts" | ||
|
||
# 依赖锁定文件 | ||
- "package-lock.json" | ||
- "pnpm-lock.yaml" | ||
- "yarn.lock" | ||
|
||
# 测试快照 | ||
- "**/__snapshots__/**" | ||
|
||
# 文档文件 | ||
- "**/*.md" | ||
|
||
# ----------------- | ||
# 审查定制 (为 Next.js 优化的指令) | ||
# ----------------- | ||
|
||
# 这是配置的核心部分!我们为 AI 提供针对 Open Source Bazaar 项目的审查指令。 | ||
extra_instructions: | | ||
这是一个基于 Next.js 15 (Pages Router) + TypeScript + MobX + React Bootstrap 的项目。请像一位资深的开发者一样进行审查,并严格遵循以下规则: | ||
|
||
1. **React Bootstrap 组件使用**: | ||
- 必须使用 React Bootstrap 组件替代自定义 HTML 元素 | ||
- 使用 `<Button variant="outline-primary">` 而不是 `<a className="btn btn-outline-primary">` | ||
- 使用 `<Badge bg="secondary">` 而不是 `<span className="badge bg-secondary">` | ||
- 优先使用现有的 Bootstrap 组件库 | ||
|
||
2. **MobX 状态管理**: | ||
- 检查 MobX store 的正确使用,包括 `@observer` 装饰器 | ||
- 确保 `@observable`、`@action`、`@computed` 的正确使用 | ||
- 验证组件正确连接到 MobX store | ||
|
||
3. **国际化 (i18n) 要求**: | ||
- 所有用户界面文本必须使用 `t()` 函数进行翻译 | ||
- 检查翻译键是否在所有语言文件中存在 (zh-CN.ts, en-US.ts, zh-TW.ts) | ||
- 使用通用术语如 `t('knowledge_base')` 而不是特定术语 | ||
|
||
4. **GitHub API 集成**: | ||
- 检查是否从 `models/Base.ts` 导入配置的 `githubClient` | ||
- 验证 GitHub API 认证和错误处理的正确实现 | ||
- 确保 Base64 内容正确解码使用 `atob(item.content)` | ||
luojiyin1987 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
luojiyin1987 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
5. **Pages Router 最佳实践**: | ||
- 检查 `getStaticProps` 和 `getServerSideProps` 的正确使用 | ||
- 验证 API 路由的结构和错误处理 | ||
- 确保静态生成时的错误处理(让错误自然冒泡) | ||
|
||
6. **TypeScript 类型安全**: | ||
- 强类型定义,避免使用 `any` 类型 | ||
- 正确使用泛型和接口 | ||
- 确保 React 组件 props 正确类型化 | ||
|
||
7. **性能优化**: | ||
- 使用 `next/image` 组件进行图片优化 | ||
- 检查不必要的重新渲染 | ||
- 确保 MobX 的响应式性能优化 | ||
|
||
8. **代码组织**: | ||
- 遵循现有的项目结构 | ||
- 使用现有的工具库(如 `web-utility`) | ||
- 保持代码的可读性和模块化 | ||
|
||
# PR 的变更行数上限。如果超过,则跳过审查。 | ||
line_limit: 1000 | ||
|
||
# PR 变更总结的类型 | ||
summarize: "default" | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.