Repository navigation
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
179 lines (154 loc) · 6.92 KB
/
Copy path.coderabbit.yaml
File metadata and controls
179 lines (154 loc) · 6.92 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
# Enables IDE autocompletion for this config file
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
# Language for CodeRabbit's review comments
language: en
# Enable experimental features (currently not using any specific early_access features)
early_access: true
chat:
# CodeRabbit will automatically respond to @coderabbitai mentions in PR comments
auto_reply: true
issue_enrichment:
labeling:
auto_apply_labels: true
labeling_instructions:
- label: bug
instructions: Issues reporting bugs, errors, crashes, incorrect behavior, or unexpected results. This includes runtime errors, logic errors, broken functionality, regressions, and any deviation from expected or documented behavior.
- label: enhancement
instructions: Feature requests, improvements to existing functionality, performance optimizations, refactoring suggestions, UI/UX enhancements, and any suggestions to make the project better or add new capabilities.
- label: documentation
instructions: Documentation updates, additions, corrections, or clarifications needed. This includes missing docs, outdated information, unclear instructions, API documentation, code examples, README improvements, and any requests for better explanations or guides.
planning:
enabled: true
auto_planning:
enabled: true
labels:
- "plan-me" # Auto-plan issues with this label
- "feature" # Also auto-plan these
- "!no-plan" # Never auto-plan issues with this label
reviews:
profile: assertive # Options: chill (focuses on significant issues, less nitpicky about style), assertive (more thorough, flags style issues and minor improvements too)
auto_review:
# Automatically trigger reviews when PRs are opened or updated
enabled: true
# Skip auto-review if PR title contains these keywords
ignore_title_keywords:
- "WIP"
# Don't auto-review draft PRs
drafts: false
# Only auto-review PRs targeting these branches
base_branches:
- main
- develop
# Include a high-level summary at the start of each review
high_level_summary: true
# Generate sequence diagrams for complex code flows
sequence_diagrams: true
# Include poems in reviews
poem: true
# Show review completion status
review_status: true
# Keep the walkthrough section expanded by default
collapse_walkthrough: false
# Include summary of all changed files
changed_files_summary: true
# Automatically request changes on the PR (just leave comments)
request_changes_workflow: true
# Pre-merge checks to enforce before merging PRs
pre_merge_checks:
description:
# Validate that PR has a proper description
mode: warning # Options: off, warning, error
docstrings:
# Disable docstring coverage checks (let's assume we don't need them)
mode: off
# Exclude these paths from reviews (build artifacts and dependencies)
path_filters:
- "!**/vendor/**" # Go dependencies
- "!**/dist/**" # Build output
- "!**/data/**" # SQLite database volume
# Use the following tools when reviewing
tools:
shellcheck:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_only: false
level: default
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
# Apply the following labels to PRs
labeling_instructions:
- label: Go Lang
instructions: Apply when the PR/MR contains changes to go source-code
- label: Bash Lang
instructions: >-
Apply when the PR/MR contains changes to shell-scripts or BASH code
snippets
- label: Make Lang
instructions: >-
Apply when the PR/MR contains changes to the file `Makefile` or makefile
code snippets
- label: Documentation
instructions: >-
Apply whenever project documentation (namely markdown source-code) is
updated by the PR/MR
- label: Linter
instructions: >-
Apply when the purpose of the PR/MR is related to fixing the feedback
from a linter
# Review instructions that apply to all files
instructions: >-
- Verify that documentation and comments are free of spelling mistakes
- Ensure that test code is automated, comprehensive, and follows testing best practices
- Verify that all critical functionality is covered by tests
- Confirm that the code meets the project's requirements and objectives
- Confirm that copyright years are up-to date whenever a file is changed
- Point out redundant obvious comments that do not add clarity to the code
- Ensure that comments are concise and suggest more concise comment statements if possible
- Look for code duplication
- Suggest code completions when:
- seeing a TODO comment
- seeing a FIXME comment
# Custom review instructions for specific file patterns
path_instructions:
# Go files
- path: "**/*.go"
instructions: |
Go:
- Check for idiomatic Go code and adherence to Effective Go principles.
- Ensure proper error handling is performed (no ignored errors).
- Validate concurrency safety (proper use of goroutines, channels, sync package).
- Ensure data persistence queries (e.g. SQLite) use parameterized queries to prevent SQL injection.
- Verify that context is propagated through function calls, especially for database operations and outgoing requests.
- Check that API handlers handle edge cases and send proper HTTP status codes.
# Go test files
- path: "**/*_test.go"
instructions: |
Review test files for:
- Comprehensive coverage of expected behavior and failure scenarios.
- Use of table-driven tests where appropriate.
- Proper mocking of external dependencies like the SQLite store.
# Dependency manifest and lock files (e.g. updated by Dependabot, Renovate)
- path: "**/{go.mod,go.sum}"
instructions: |
This file may be modified by a dependency bot (e.g., Dependabot, Renovate).
Perform a structured dependency upgrade analysis:
**1. Version Change Assessment**
- Identify all version bumps (major, minor, patch) and flag major/minor upgrades explicitly.
- Check the official release notes, changelog, or migration guide for each upgraded package.
**2. Breaking Change Detection**
- Breaking changes: removed or renamed APIs, changed function signatures, altered behavior.
- Security fixes: highlight CVE patches and confirm they address known vulnerabilities.
**3. Codebase Compatibility Check**
- Locate all files in the repo that import or use the upgraded dependency.
- For each usage, verify that changes do not silently break existing logic.
Conclude with a **risk level**: Low / Medium / High, with justification.