-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
187 lines (166 loc) · 5.47 KB
/
.coderabbit.yaml
File metadata and controls
187 lines (166 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# CodeRabbit Configuration
# Docs: https://docs.coderabbit.ai/guides/configure-coderabbit
language: "pt-BR"
tone_instructions: |
Seja direto e técnico. Foque em:
- Segurança (OWASP Top 10, CWE)
- Performance e complexidade ciclomática
- Manutenibilidade e Clean Architecture
- Type safety e validação de inputs
Evite sugestões triviais ou cosméticas.
early_access: true
reviews:
auto_review:
enabled: true
drafts: false
base_branches:
- main
- develop
ignore_title_keywords:
- "WIP"
- "DO NOT MERGE"
- "DRAFT"
- "[skip ci]"
- "[no review]"
high_level_summary: true
high_level_summary_placeholder: "@coderabbitai summary"
poem: false
review_status: true
collapse_walkthrough: false
changed_files_summary: true
sequence_diagrams: true
path_filters:
- "!.venv/**"
- "!**/__pycache__/**"
- "!.hypothesis/**"
- "!htmlcov/**"
- "!.ruff_cache/**"
- "!.mypy_cache/**"
- "!.pytest_cache/**"
- "!*.egg-info/**"
- "!uv.lock"
- "!*.lock"
- "!.coverage"
- "!coverage.xml"
- "!*.min.js"
- "!*.min.css"
- "!node_modules/**"
- "!dist/**"
- "!build/**"
path_instructions:
- path: "src/**/*.py"
instructions: |
Verifique rigorosamente:
SEGURANÇA (P0):
- SQL injection: queries parametrizadas obrigatórias
- Input validation: Pydantic com constraints
- Secrets: nunca hardcoded, usar env vars
- Auth: verificar decorators de permissão
- XSS/CSRF: sanitização de outputs
QUALIDADE:
- Complexidade ciclomática < 10
- Funções: máximo 50 linhas
- Arquivos: máximo 400 linhas
- Nesting: máximo 3 níveis
- Type hints: strict mypy compliance
PADRÕES:
- Clean Architecture: separação de camadas
- SOLID principles
- Result pattern para erros esperados
- Async/await correto (sem blocking calls)
- Logging estruturado (sem print)
- path: "tests/**/*.py"
instructions: |
Verifique:
- Cobertura de edge cases e error paths
- Nomenclatura: test_should_<expected>_when_<condition>
- Arrange-Act-Assert pattern
- Sem dados sensíveis em fixtures
- Property-based tests para lógica complexa
- Mocks apropriados (não mock demais)
- Assertions específicas (não apenas assertTrue)
- path: "alembic/**/*.py"
instructions: |
Verifique:
- Migrations reversíveis (upgrade E downgrade)
- Sem dados sensíveis ou PII
- Índices para foreign keys
- Constraints apropriados (NOT NULL, UNIQUE, CHECK)
- Transações atômicas
- Backward compatibility quando possível
- path: "deployments/terraform/**/*.tf"
instructions: |
Verifique:
- Sem secrets hardcoded (use variables/secrets manager)
- Tags obrigatórias: Environment, Project, Owner, ManagedBy
- Encryption at rest habilitado
- Least privilege IAM policies
- Logging e monitoring habilitados
- Backup e disaster recovery configurados
- Security groups restritivos
- path: "deployments/**/*.yaml"
instructions: |
Verifique:
- Sem secrets em plain text (use External Secrets/Sealed Secrets)
- Resource limits e requests definidos
- Health checks (liveness, readiness, startup)
- Security context: runAsNonRoot, readOnlyRootFilesystem
- Network policies restritivas
- Pod disruption budgets para HA
- Service accounts dedicados
- path: ".github/workflows/**/*.yml"
instructions: |
Verifique:
- Permissions explícitas e mínimas (least privilege)
- Actions pinadas por SHA (não tags)
- Secrets via GitHub Secrets
- Timeout configurado em todos os jobs
- Concurrency groups para evitar runs duplicados
- Cache de dependências otimizado
- persist-credentials: false em checkouts
- path: "pyproject.toml"
instructions: |
Verifique:
- Versões de dependências com range seguro
- Sem dependências não utilizadas
- Dependências de segurança atualizadas
- Optional dependencies bem organizados
- Configurações de tools consistentes
- path: "src/**/config/**/*.py"
instructions: |
Verifique:
- Validação de todas as configurações
- Defaults seguros (não permissivos)
- Documentação de cada campo
- Sem valores padrão sensíveis
- Tipagem forte com Pydantic
- path: "src/infrastructure/auth/**/*.py"
instructions: |
CRÍTICO - Código de autenticação:
- Timing-safe comparisons
- Rate limiting em endpoints de auth
- Token expiration adequado
- Secure password hashing (Argon2/bcrypt)
- Audit logging de eventos de auth
- Proteção contra brute force
- path: "src/infrastructure/db/**/*.py"
instructions: |
Verifique:
- Connection pooling configurado
- Queries parametrizadas (NUNCA string interpolation)
- Transactions apropriadas
- Índices para queries frequentes
- N+1 query prevention
- Timeout de conexão
chat:
auto_reply: true
knowledge_base:
learnings:
scope: auto
issues:
scope: auto
jira:
project_keys: []
linear:
team_keys: []
opt_out: false