-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
203 lines (184 loc) · 11.1 KB
/
Copy path.coderabbit.yaml
File metadata and controls
203 lines (184 loc) · 11.1 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US
tone_instructions: >-
Be direct and evidence-first. Report only concrete, actionable findings grounded in changed code.
Prioritize correctness, security, data loss, lifecycle, and regressions; avoid speculative style
comments and unrelated refactors.
chat:
allow_non_org_members: false
knowledge_base:
web_search:
enabled: true
learnings:
scope: local
reviews:
profile: assertive
request_changes_workflow: true
high_level_summary: true
high_level_summary_in_walkthrough: true
review_status: true
review_details: true
collapse_walkthrough: true
changed_files_summary: true
poem: false
auto_review:
enabled: false
drafts: false
auto_incremental_review: true
auto_pause_after_reviewed_commits: 0
labels:
- "coderabbit-review-active"
path_filters:
- "!**/node_modules/**"
- "!**/dist/**"
- "!**/out/**"
- "!**/coverage/**"
- "!**/.turbo/**"
- "!apps/vscode-e2e/.vscode-test/**"
- "!bin/*.vsix"
- "!webview-ui/**/__screenshots__/**"
path_instructions:
- path: "**/*"
instructions: >-
Act as an adversarial second-opinion reviewer. Verify PR claims against implementation and
contracts. Trace changed inputs through normal, boundary, error, cancellation, retry, and
default paths and their consumers. Seek plausible counterexamples and regressions from removed
safeguards. Identify assumptions in changed code that depend on facts outside the diff. First
verify repository conventions, tests, and related implementations. When a potential finding
depends on external behavior, use web search and prefer official documentation, specifications,
or upstream repositories. Report only concrete, actionable conflicts or failure modes, citing
the relevant repository location or external source. Prioritize correctness, security, data loss,
lifecycle, and test gaps. Do not report generic best practices, unsupported concerns, speculative
style comments, or unrelated refactors. When changed code introduces a local implementation of a
cross-cutting concern, check whether it bypasses or duplicates an established repository abstraction
or nearby convention. Report only a concrete inconsistency with behavioral or maintenance impact,
and allow intentional deviations.
- path: "**/*.{ts,tsx,js,jsx,mts,mjs,cts,cjs}"
instructions: >-
Check strict typing and exhaustive behavior across normal, boundary, error,
cancellation, retry, and compatibility paths. Verify promises and errors are handled,
existing helpers are reused, and new code introduces no `any`, unjustified double
assertions, floating promises, duplicated helpers, or increased lint suppressions.
When a refactor adds early-return guards that redirect a subset of inputs to a new
code path, confirm the old branches for those inputs are removed or unreachable.
- path: "{**/*.{test,spec}.{ts,tsx,js,jsx},**/__tests__/**}"
instructions: >-
Require regression coverage at the lowest valid harness with behavior-focused
assertions, including relevant negative, error, false/unset, and boundary cases.
Check cleanup and deterministic async behavior and prefer shared typed test helpers.
Visible webview changes require a durable Playwright component snapshot; behavior-only
changes do not.
Reject weak assertions on values that could take multiple forms: .toBeDefined() or
.toHaveBeenCalled() alone are not sufficient when the actual type, value, or object
identity is verifiable. For listener registration and removal, assert the same function
reference was added and removed (not expect.any(Function)).
Flag tests that assert in-flight behavior only after the call completes — these cannot
prove the behavior fires during execution. Check that describe block names match the
actual subjects of the tests they contain.
For tests that assert only mock call counts, confirm a corresponding return-value
assertion exists; a regression that silently returns stale fallback data can satisfy
a call-count check. For code with fallback behavior, verify both the cold-start case
(no prior state) and the warm case (prior state exists) are covered, as they exercise
different branches.
- path: "apps/vscode-e2e/**"
instructions: >-
Reserve end-to-end coverage for behavior that requires the real VS Code host, workspace
APIs, extension activation, webview messaging, file watchers, or a full workflow. Keep
detailed protocol, parsing, storage, retry, and edge cases at lower test layers.
- path: "{packages/types/src/**,webview-ui/src/components/settings/**,src/core/config/**,src/core/webview/**}"
instructions: >-
For persisted settings, verify the complete schema/storage/runtime/webview round trip,
shared default semantics, and focused true plus false/unset tests. SettingsView controls
must read and update local `cachedState`, include the value in the explicit save payload,
and receive the persisted value back from extension state.
- path: "src/**"
instructions: >-
Verify extension/webview contracts, cancellation and error propagation, VS Code
lifecycle correctness, and behavior under retries and partial failure. Check listeners,
resources, and providers are disposed without stale state or duplicate work.
- path: "webview-ui/**"
instructions: >-
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark
theme behavior. New markup should use Tailwind; add VS Code CSS variables to
`src/index.css` before Tailwind use. Use Vitest for behavior and Playwright component
snapshots only for durable visible changes.
- path: "{src/api/**,src/core/prompts/**,src/core/tools/**,src/services/mcp/**,src/services/destructive-command-guard/**}"
instructions: >-
Treat model, provider, MCP, path, command, and tool data as untrusted. Check approval and
allowlist bypasses, injection and traversal risks, secrets/PII exposure in logs, abort and
stream behavior, retries, provider compatibility, and enforcement at execution time—not
only at presentation or planning time.
- path: "{src/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**,packages/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**,webview-ui/src/**/{state,history,task,tasks,service,services,cache,caches,worktree,worktrees}/**}"
instructions: >-
Check persistence and lifecycle invariants: awaited atomic writes, rollback or explicit
partial-failure behavior, cross-window state consistency, stale listeners/watchers,
cancellation, idempotency, and safe restart/resume without lost or duplicated state.
For async functions that read shared mutable state before an `await` and write it back
after, verify the captured reference is still valid when the write executes; a concurrent
mutation during the await can cause a stale snapshot to overwrite a newer state.
- path: ".github/**"
instructions: >-
Require full commit SHA pins, least-privilege permissions, safe expression and shell
interpolation, and trusted metadata handling. Privileged workflows must never check out,
execute, install from, or otherwise trust a fork PR head.
- path: "{AGENTS.md,**/AGENTS.md,CONTRIBUTING.md,.changeset/**,CHANGELOG.md,src/CHANGELOG.md}"
instructions: >-
Enforce repository policy: routine PRs must not add changesets or edit changelogs except
during release preparation. Verify documentation describes real behavior and contracts,
and deprioritize prose-only nits that do not affect correctness or usability.
finishing_touches:
docstrings:
enabled: false
pre_merge_checks:
override_requested_reviewers_only: true
docstrings:
mode: off
title:
mode: warning
description:
mode: warning
issue_assessment:
mode: error
custom_checks:
- name: Regression evidence
mode: error
instructions: >-
Fail only when a concrete changed behavior lacks focused coverage at the lowest valid
test layer, tests merely mirror implementation, an affected error/negative/unset branch
is omitted, or a durable visible UI change lacks its required Playwright component
snapshot. Do not demand tests for unchanged behavior, mechanical configuration, or every
branch without a plausible regression scenario. Cite the changed behavior and missing
evidence.
- name: Security boundaries
mode: error
instructions: >-
Fail only when a concrete changed path leaks secrets or PII, trusts or executes
unvalidated input, or bypasses approval or allowlist controls. Cite the changed path
and a plausible triggering scenario; pass when no such changed path exists.
- name: Persistence integrity
mode: error
instructions: >-
Fail only when a concrete changed persistence path can lose or corrupt state because an
operation is not awaited, a write is non-atomic, rollback or explicit partial-failure
behavior is missing, or a persisted default is not propagated to a consumer. Cite the
changed path and a plausible triggering scenario; pass when no such changed path exists.
- name: Lifecycle resource cleanup
mode: error
instructions: >-
Fail only when a concrete changed lifecycle path can leak a listener, watcher, provider,
timer, task, or other resource, or can duplicate work after cancellation, disposal, or
restart. Cite the changed path and a plausible triggering scenario; pass when no such
changed path exists.
tools:
eslint:
enabled: true
github-checks:
enabled: true
actionlint:
enabled: true
shellcheck:
enabled: true
gitleaks:
enabled: true
semgrep:
enabled: true