Skip to content

Commit db4dd8a

Browse files
committed
chore(coderabbit): add custom finishing touch recipes
1 parent 38ce0e0 commit db4dd8a

File tree

1 file changed

+91
-24
lines changed

1 file changed

+91
-24
lines changed

.coderabbit.yaml

Lines changed: 91 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
# https://docs.coderabbit.ai/getting-started/configure-coderabbit
3+
14
# CodeRabbit Configuration
25
# Optimized for Node.js 24 (LTS) / Express.js 5 / TypeScript project
36

47
language: en-US
58
early_access: true
6-
enable_free_tier: true
79

810
reviews:
911
profile: chill
@@ -23,12 +25,9 @@ reviews:
2325
suggested_labels: true
2426
auto_apply_labels: false
2527
suggested_reviewers: false
26-
auto_assign_reviewers: false
27-
in_progress_fortune: true
2828
poem: false
2929
abort_on_close: true
3030

31-
# Path-based review instructions for this TypeScript/Express project
3231
path_instructions:
3332
- path: "src/**/*.ts"
3433
instructions: |
@@ -160,7 +159,6 @@ reviews:
160159
- Ensure environment variables are properly set
161160
- Validate volume configurations for persistence
162161
163-
# Ignore patterns for this project
164162
path_filters:
165163
- "!**/node_modules/**"
166164
- "!**/dist/**"
@@ -188,56 +186,122 @@ reviews:
188186
enabled: true
189187
unit_tests:
190188
enabled: true
189+
custom:
190+
- name: "sync documentation"
191+
instructions: |
192+
This is a PoC/learning project targeting developers unfamiliar with the stack.
193+
Documentation is a first-class concern. Review the PR changes and perform the
194+
following three checks:
195+
196+
## 1. Method/function docstrings
197+
For every public function, method, or handler touched in the PR:
198+
- If it lacks a docstring/doc comment, add one using the idiomatic format
199+
for the language and framework in use.
200+
- If it has one but no longer matches the current signature, parameters,
201+
or behavior, update it.
202+
- Docstrings should explain *why* and *what*, not just restate the signature.
203+
Assume the reader is learning the language.
204+
205+
## 2. README.md
206+
Check whether the PR introduces or removes endpoints, changes behavior,
207+
adds dependencies, or modifies how to run the project.
208+
If so, update the relevant sections of README.md to reflect the current state.
209+
Do not rewrite sections unrelated to the changes.
210+
211+
## 3. .github/copilot-instructions.md
212+
If the PR introduces patterns, conventions, or architectural decisions that
213+
should guide future AI-assisted contributions, add or update the relevant
214+
instructions in .github/copilot-instructions.md.
215+
Focus on things a developer (or AI assistant) unfamiliar with this specific
216+
stack implementation should know before writing code here.
217+
218+
- name: "enforce http error handling"
219+
instructions: |
220+
Audit all HTTP handler functions in the changed files.
221+
Ensure errors return appropriate HTTP status codes (400 for bad input,
222+
404 for not found, 500 for unexpected errors) and a consistent JSON error
223+
body with at least a "message" field.
224+
Flag handlers that return 200 on error or swallow errors silently.
225+
Use idiomatic error handling patterns for the language and framework in use.
226+
227+
- name: "idiomatic review"
228+
instructions: |
229+
Review the changed files for non-idiomatic patterns given the language and
230+
framework in use. Flag code that looks like it was translated from another
231+
language rather than written naturally for this stack. Suggest idiomatic
232+
alternatives with brief explanations. This is a PoC comparison project,
233+
so idiomatic usage is a first-class concern.
234+
235+
- name: "verify api contract"
236+
instructions: |
237+
Review the changed files and verify that all HTTP endpoints (method, path,
238+
request body shape, and response shape) match the project's intended REST API
239+
contract. Check the README or any spec/contract file in the repo for reference.
240+
Flag any deviations — missing fields, wrong status codes, inconsistent naming.
241+
Do not make changes; only report findings as a comment.
191242
192243
pre_merge_checks:
193244
docstrings:
194245
mode: warning
195-
threshold: 75
246+
threshold: 80
196247
title:
197248
mode: warning
198249
requirements: |
199250
- Use Conventional Commits format (feat:, fix:, chore:, docs:, test:, refactor:)
200251
- Keep under 80 characters
201252
- Be descriptive and specific
202253
description:
203-
mode: warning
254+
mode: off
204255
issue_assessment:
205-
mode: warning
256+
mode: off
206257

207258
tools:
208-
# Relevant tools for TypeScript/Node.js projects
259+
# Secret scanners
260+
gitleaks:
261+
enabled: true
262+
trufflehog:
263+
enabled: true
264+
265+
# IaC / infrastructure
266+
checkov:
267+
enabled: true
268+
trivy:
269+
enabled: true
270+
hadolint:
271+
enabled: true
272+
273+
# General static analysis
274+
semgrep:
275+
enabled: true
276+
opengrep:
277+
enabled: true
209278
eslint:
210279
enabled: true
211280
oxc:
212281
enabled: true
213282
biome:
214283
enabled: true
215-
gitleaks:
216-
enabled: true
217-
checkov:
218-
enabled: true
219-
hadolint:
284+
shellcheck:
220285
enabled: true
286+
287+
# File-type linters
221288
yamllint:
222289
enabled: true
223290
actionlint:
224291
enabled: true
225-
semgrep:
226-
enabled: true
227292
markdownlint:
228293
enabled: true
229-
github-checks:
230-
enabled: true
231-
timeout_ms: 120000
232294
dotenvLint:
233295
enabled: true
234296
checkmake:
235297
enabled: true
236298
osvScanner:
237299
enabled: true
238-
shellcheck:
300+
github-checks:
239301
enabled: true
240-
# Disable irrelevant tools for TypeScript project
302+
timeout_ms: 120000
303+
304+
# Disable irrelevant tools for this TypeScript project
241305
ruff:
242306
enabled: false
243307
swiftlint:
@@ -288,6 +352,12 @@ reviews:
288352
enabled: false
289353
fortitudeLint:
290354
enabled: false
355+
stylelint:
356+
enabled: false
357+
blinter:
358+
enabled: false
359+
psscriptanalyzer:
360+
enabled: false
291361

292362
chat:
293363
art: true
@@ -300,10 +370,7 @@ knowledge_base:
300370
code_guidelines:
301371
enabled: true
302372
filePatterns:
303-
- "CONTRIBUTING.md"
304-
- "CODE_OF_CONDUCT.md"
305373
- ".github/copilot-instructions.md"
306-
- ".cursorrules"
307374
learnings:
308375
scope: auto
309376
issues:

0 commit comments

Comments
 (0)