Skip to content

Commit 29b4c4a

Browse files
authored
Merge pull request #276 from nanotaboada/chore/coderabbit-custom-recipes
chore(coderabbit): add custom finishing touch recipes
2 parents 7d65df3 + 57a1450 commit 29b4c4a

File tree

1 file changed

+88
-26
lines changed

1 file changed

+88
-26
lines changed

.coderabbit.yaml

Lines changed: 88 additions & 26 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 Java 25 (LTS) / Spring Boot 4 RESTful Web Service 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 Java/Spring Boot project
3231
path_instructions:
3332
- path: "src/main/java/**/*.java"
3433
instructions: |
@@ -146,7 +145,6 @@ reviews:
146145
- Check proper shebang and error handling
147146
- Ensure proper permissions handling
148147
149-
# Ignore patterns for this project
150148
path_filters:
151149
- "!**/target/**"
152150
- "!**/storage/**"
@@ -173,6 +171,59 @@ reviews:
173171
enabled: true
174172
unit_tests:
175173
enabled: true
174+
custom:
175+
- name: "sync documentation"
176+
instructions: |
177+
This is a PoC/learning project targeting developers unfamiliar with the stack.
178+
Documentation is a first-class concern. Review the PR changes and perform the
179+
following three checks:
180+
181+
## 1. Method/function docstrings
182+
For every public function, method, or handler touched in the PR:
183+
- If it lacks a docstring/doc comment, add one using the idiomatic format
184+
for the language and framework in use.
185+
- If it has one but no longer matches the current signature, parameters,
186+
or behavior, update it.
187+
- Docstrings should explain *why* and *what*, not just restate the signature.
188+
Assume the reader is learning the language.
189+
190+
## 2. README.md
191+
Check whether the PR introduces or removes endpoints, changes behavior,
192+
adds dependencies, or modifies how to run the project.
193+
If so, update the relevant sections of README.md to reflect the current state.
194+
Do not rewrite sections unrelated to the changes.
195+
196+
## 3. .github/copilot-instructions.md
197+
If the PR introduces patterns, conventions, or architectural decisions that
198+
should guide future AI-assisted contributions, add or update the relevant
199+
instructions in .github/copilot-instructions.md.
200+
Focus on things a developer (or AI assistant) unfamiliar with this specific
201+
stack implementation should know before writing code here.
202+
203+
- name: "enforce http error handling"
204+
instructions: |
205+
Audit all HTTP handler functions in the changed files.
206+
Ensure errors return appropriate HTTP status codes (400 for bad input,
207+
404 for not found, 500 for unexpected errors) and a consistent JSON error
208+
body with at least a "message" field.
209+
Flag handlers that return 200 on error or swallow errors silently.
210+
Use idiomatic error handling patterns for the language and framework in use.
211+
212+
- name: "idiomatic review"
213+
instructions: |
214+
Review the changed files for non-idiomatic patterns given the language and
215+
framework in use. Flag code that looks like it was translated from another
216+
language rather than written naturally for this stack. Suggest idiomatic
217+
alternatives with brief explanations. This is a PoC comparison project,
218+
so idiomatic usage is a first-class concern.
219+
220+
- name: "verify api contract"
221+
instructions: |
222+
Review the changed files and verify that all HTTP endpoints (method, path,
223+
request body shape, and response shape) match the project's intended REST API
224+
contract. Check the README or any spec/contract file in the repo for reference.
225+
Flag any deviations — missing fields, wrong status codes, inconsistent naming.
226+
Do not make changes; only report findings as a comment.
176227
177228
pre_merge_checks:
178229
docstrings:
@@ -185,41 +236,53 @@ reviews:
185236
- Keep under 80 characters
186237
- Be descriptive and specific
187238
description:
188-
mode: warning
239+
mode: off
189240
issue_assessment:
190-
mode: warning
241+
mode: off
191242

192243
tools:
193-
# Relevant tools for Java/Spring Boot projects
194-
pmd:
195-
enabled: true
244+
# Secret scanners
196245
gitleaks:
197246
enabled: true
247+
trufflehog:
248+
enabled: true
249+
250+
# IaC / infrastructure
198251
checkov:
199252
enabled: true
253+
trivy:
254+
enabled: true
200255
hadolint:
201256
enabled: true
257+
258+
# General static analysis
259+
semgrep:
260+
enabled: true
261+
opengrep:
262+
enabled: true
263+
pmd:
264+
enabled: true
265+
shellcheck:
266+
enabled: true
267+
268+
# File-type linters
202269
yamllint:
203270
enabled: true
204271
actionlint:
205272
enabled: true
206-
semgrep:
207-
enabled: true
208273
markdownlint:
209274
enabled: true
210-
github-checks:
211-
enabled: true
212-
timeout_ms: 120000
213275
dotenvLint:
214276
enabled: true
215277
checkmake:
216278
enabled: true
217279
osvScanner:
218280
enabled: true
219-
shellcheck:
281+
github-checks:
220282
enabled: true
283+
timeout_ms: 120000
221284

222-
# Disable irrelevant tools for Java project
285+
# Disable irrelevant tools for this Java project
223286
ruff:
224287
enabled: false
225288
biome:
@@ -274,6 +337,12 @@ reviews:
274337
enabled: false
275338
fortitudeLint:
276339
enabled: false
340+
stylelint:
341+
enabled: false
342+
blinter:
343+
enabled: false
344+
psscriptanalyzer:
345+
enabled: false
277346

278347
chat:
279348
art: true
@@ -286,14 +355,7 @@ knowledge_base:
286355
code_guidelines:
287356
enabled: true
288357
filePatterns:
289-
- "src/**/*.java"
290-
- "**/pom.xml"
291-
- "**/application.properties"
292-
- "**/logback-spring.xml"
293-
- "**/Dockerfile"
294-
- "**/*.yml"
295-
- "**/*.yaml"
296-
- "**/*.sh"
358+
- ".github/copilot-instructions.md"
297359
learnings:
298360
scope: auto
299361
issues:
@@ -325,7 +387,7 @@ code_generation:
325387
- Use AssertJ for fluent assertions
326388
- Include @AutoConfigureCache for slice tests with caching
327389
- Use test data factories for consistent test data
328-
- Target 80% coverage (exclude Application.java and models)
390+
- Target 85% coverage (exclude Application.java and models)
329391
330392
issue_enrichment:
331393
auto_enrich:

0 commit comments

Comments
 (0)