Skip to content

Commit 7f63a73

Browse files
authored
chore: setup CodeRabbit com path instructions (#8)
- Adiciona .coderabbit.yaml na raiz - Path instructions cobrem auth, api, middleware, migrations, schema, Dockerfile, GitHub Actions, env.example, package.json, requirements.txt, pubspec.yaml, docs - tone_instructions em pt-BR com regra anti em-dash - auto_review em base main, sem drafts - path_filters excluem build artifacts, lockfiles, binarios, db files, .env Permite CodeRabbit revisar PRs automaticamente.
1 parent bed1925 commit 7f63a73

1 file changed

Lines changed: 216 additions & 0 deletions

File tree

.coderabbit.yaml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
# CodeRabbit Configuration - Nikolas de Hor projects
3+
# Template universal: cobre stacks variadas (Next.js, React, FastAPI, Python CLI, MCP servers, Flutter, Static, Shell)
4+
5+
language: "pt-BR"
6+
tone_instructions: "Seja profissional, construtivo e focado em qualidade. Comentários em português do Brasil. Sem em dashes (— ou –), usar hífens (-) ou vírgulas. Nome do autor: Nikolas de Hor. Goiânia sempre com acento."
7+
early_access: false
8+
9+
reviews:
10+
auto_review:
11+
enabled: true
12+
base_branches:
13+
- main
14+
drafts: false
15+
auto_incremental_review: false
16+
17+
request_changes_workflow: false
18+
high_level_summary: true
19+
poem: false
20+
review_status: true
21+
collapse_walkthrough: false
22+
23+
path_instructions:
24+
- path: "**/*.{ts,tsx,js,jsx}"
25+
instructions: |
26+
TypeScript/JavaScript geral. Verificar:
27+
- Tipos estritos quando possível (evitar any sem justificativa).
28+
- Async/await sem unhandled promise rejection.
29+
- Imports organizados (sem ciclos).
30+
- Sem console.log esquecido em produção.
31+
- Sem credenciais hardcoded ou tokens.
32+
- process.env validado (não usar undefined silenciosamente).
33+
34+
- path: "**/*.{py}"
35+
instructions: |
36+
Python geral. Verificar:
37+
- PEP 8 e type hints quando aplicável.
38+
- try/except específico (não capturar Exception nu).
39+
- Sem credenciais hardcoded.
40+
- os.environ validado.
41+
- SQL queries parametrizadas (nunca f-string em SQL).
42+
- Subprocess sem shell=True com input não confiável.
43+
44+
- path: "**/*.{dart}"
45+
instructions: |
46+
Dart/Flutter geral. Verificar:
47+
- null safety estrito.
48+
- StatelessWidget preferido quando não há state.
49+
- Async/await com error handling.
50+
- BuildContext não usado após dispose.
51+
- Sem chaves hardcoded.
52+
53+
- path: "**/auth/**"
54+
instructions: |
55+
Auth crítico. Verificar:
56+
- Secrets sempre via env vars.
57+
- Tokens com expiração apropriada.
58+
- bcrypt rounds >= 10 (idealmente 12).
59+
- Endpoints não vazam existência de usuário.
60+
- Rate limit em login/signup/forgot-password.
61+
- Logout limpa estado completamente (localStorage, cookies, refresh token).
62+
63+
- path: "**/api/**"
64+
instructions: |
65+
API endpoints. Verificar:
66+
- Validação de entrada via schema (Zod, Pydantic, class-validator).
67+
- Rate limiting onde aplicável.
68+
- Mensagens de erro não vazam stack trace em produção.
69+
- Status codes corretos (401 vs 403, 400 vs 422).
70+
- CORS configurado de forma restritiva.
71+
72+
- path: "**/middleware*"
73+
instructions: |
74+
Middleware. Verificar:
75+
- Matcher cobre todas rotas pretendidas.
76+
- Não bloqueia rotas públicas por engano.
77+
- Headers de segurança aplicados (CSP, X-Frame-Options, etc).
78+
79+
- path: "**/migrations/**"
80+
instructions: |
81+
Database migrations. Verificar:
82+
- Não destrutivas sem backup (DROP TABLE, DROP COLUMN).
83+
- Rollback documentado.
84+
- Mudança de tipo de coluna tem migração de dados.
85+
- FK com índice no lado FK.
86+
87+
- path: "**/schema.{prisma,sql}"
88+
instructions: |
89+
Schema database. Verificar:
90+
- Índices em colunas frequentemente filtradas.
91+
- Unique constraints onde aplicável.
92+
- Relations com onDelete coerente.
93+
- Tipos apropriados (não usar String pra ID quando UUID/Int fazem sentido).
94+
95+
- path: "**/Dockerfile*"
96+
instructions: |
97+
Dockerfile. Verificar:
98+
- Multi-stage quando build é separado de runtime.
99+
- User não-root no runtime.
100+
- HEALTHCHECK configurado.
101+
- Sem segredos hardcoded.
102+
- Versão da base image fixada (não latest).
103+
- .dockerignore presente pra reduzir contexto.
104+
105+
- path: "**/.github/workflows/**"
106+
instructions: |
107+
GitHub Actions. Verificar:
108+
- Secrets via ${{ secrets.* }}, nunca hardcoded.
109+
- Concurrency group pra evitar runs duplicados.
110+
- Permissions explicitas (preferir least privilege).
111+
- actions/checkout@vX com versão fixa ou SHA.
112+
- Cache strategy não vaza dependências privadas.
113+
114+
- path: "**/*.env.example"
115+
instructions: |
116+
Env example. Verificar:
117+
- APENAS placeholders, nunca valores reais.
118+
- Sem project-refs reais (Supabase, Firebase, etc).
119+
- Documentação clara de onde obter cada chave.
120+
- Variáveis NEXT_PUBLIC_* / VITE_* / REACT_APP_* só pra valores PÚBLICOS.
121+
122+
- path: "**/package.json"
123+
instructions: |
124+
package.json. Verificar:
125+
- Sem dependências desnecessárias (sugerir devDeps quando aplicável).
126+
- Scripts não expõem secrets.
127+
- Sem versões "latest" (preferir SemVer explícito).
128+
129+
- path: "**/requirements*.txt"
130+
instructions: |
131+
Python requirements. Verificar:
132+
- Versões pinadas (==X.Y.Z), não open-ended.
133+
- Sem pacotes obsoletos com CVEs conhecidos.
134+
135+
- path: "**/pubspec.yaml"
136+
instructions: |
137+
Flutter pubspec. Verificar:
138+
- Versões SDK e Flutter especificadas.
139+
- Dependências sem ^ aberto demais.
140+
- Sem assets bloated.
141+
142+
- path: "**/*.md"
143+
instructions: |
144+
Documentação. Verificar:
145+
- Linguagem clara em pt-BR ou en consistente no arquivo.
146+
- Exemplos de código funcionam (sintaxe correta).
147+
- Links não quebrados (relative ou absolute consistentes).
148+
- Sem em dashes (usar hífens).
149+
- "Goiânia" sempre com acento se mencionada.
150+
151+
path_filters:
152+
# Build artifacts
153+
- "!**/node_modules/**"
154+
- "!**/dist/**"
155+
- "!**/build/**"
156+
- "!**/.next/**"
157+
- "!**/.nuxt/**"
158+
- "!**/.svelte-kit/**"
159+
- "!**/.output/**"
160+
- "!**/.cache/**"
161+
- "!**/coverage/**"
162+
# Lockfiles
163+
- "!**/package-lock.json"
164+
- "!**/yarn.lock"
165+
- "!**/pnpm-lock.yaml"
166+
- "!**/poetry.lock"
167+
- "!**/Pipfile.lock"
168+
- "!**/Cargo.lock"
169+
- "!**/composer.lock"
170+
# Minified
171+
- "!**/*.min.js"
172+
- "!**/*.min.css"
173+
- "!**/*.bundle.*"
174+
- "!**/*.generated.*"
175+
# Snapshots/cache
176+
- "!**/*.snap"
177+
- "!**/__pycache__/**"
178+
- "!**/.pytest_cache/**"
179+
- "!**/.mypy_cache/**"
180+
- "!**/.ruff_cache/**"
181+
# DB/local
182+
- "!**/*.db"
183+
- "!**/*.sqlite"
184+
- "!**/*.sqlite3"
185+
# Env files (sempre proteger)
186+
- "!**/.env"
187+
- "!**/.env.local"
188+
- "!**/.env.production"
189+
- "!**/.env.development"
190+
# Binários
191+
- "!**/*.png"
192+
- "!**/*.jpg"
193+
- "!**/*.jpeg"
194+
- "!**/*.gif"
195+
- "!**/*.ico"
196+
- "!**/*.svg"
197+
- "!**/*.webp"
198+
- "!**/*.avif"
199+
- "!**/*.woff"
200+
- "!**/*.woff2"
201+
- "!**/*.ttf"
202+
- "!**/*.eot"
203+
- "!**/*.pdf"
204+
- "!**/*.zip"
205+
- "!**/*.tar.gz"
206+
# Mobile builds
207+
- "!**/android/build/**"
208+
- "!**/ios/Pods/**"
209+
- "!**/*.ipa"
210+
- "!**/*.apk"
211+
- "!**/*.aab"
212+
# Próprio config
213+
- "!.coderabbit.yaml"
214+
215+
chat:
216+
auto_reply: true

0 commit comments

Comments
 (0)