Skip to content

Commit f78f207

Browse files
Merge pull request #3081 from stbenjam/coderabbit
Bootstrap a coderabbit configuration
2 parents 3c4552c + 47ae3ec commit f78f207

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.coderabbit.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
language: en-US
2+
early_access: false
3+
reviews:
4+
profile: chill
5+
request_changes_workflow: false
6+
high_level_summary: true
7+
poem: false
8+
review_status: true
9+
collapse_walkthrough: false
10+
auto_review:
11+
enabled: true
12+
drafts: true
13+
pre_merge_checks:
14+
custom_checks:
15+
- name: "Go Error Handling"
16+
mode: warning
17+
instructions: |
18+
Ensure proper Go error handling patterns:
19+
- Never ignore errors with `_` without justification
20+
- Errors should be wrapped with context using fmt.Errorf with %w
21+
- Avoid panic() except in init() or fatal conditions
22+
- Check for nil before dereferencing pointers
23+
24+
- name: "SQL Injection Prevention"
25+
mode: error
26+
instructions: |
27+
Prevent SQL injection vulnerabilities:
28+
- NEVER concatenate user input into SQL queries
29+
- Always use parameterized queries with $1, $2, etc.
30+
- Flag any string concatenation in SQL query construction
31+
- Use prepared statements for repeated queries
32+
33+
- name: "Excessive CSS in React Should Use Styles"
34+
mode: warning
35+
instructions: |
36+
React components with extensive inline CSS should use the useStyles pattern:
37+
- Flag inline style objects with more than 3-4 style properties
38+
- Suggest extracting complex styles to useStyles() or styled components
39+
- Inline styles are acceptable for simple, dynamic values
40+
- Prefer useStyles for maintainability and reusability
41+
42+
❌ Avoid:
43+
- Large inline style objects in JSX
44+
- Repeated style definitions across components
45+
46+
✅ Prefer:
47+
- useStyles() hook for complex styling
48+
- CSS modules or styled components
49+
- Inline styles only for dynamic values (e.g., width based on props)
50+
51+
- name: "Single Responsibility and Clear Naming"
52+
mode: warning
53+
instructions: |
54+
Keep structs and methods focused on a single concept with clear, evocative names:
55+
- Structs should represent one cohesive concept or entity
56+
- Methods should do one thing well
57+
- Names should clearly communicate purpose and responsibility
58+
- Avoid generic names like "Manager", "Handler", "Util" without specific context
59+
- Flag structs with too many unrelated fields or methods
60+
61+
❌ Avoid:
62+
- Structs that combine multiple unrelated responsibilities
63+
- Method names that don't indicate what they do (e.g., "Process", "Handle", "Do")
64+
- Overly broad structs accumulating miscellaneous functionality
65+
66+
✅ Prefer:
67+
- Descriptive names that evoke the specific concept (e.g., "TestResultAggregator" not "Manager")
68+
- Methods with clear, action-oriented names (e.g., "CalculatePassRate" not "Calculate")
69+
- Splitting large structs into focused, single-purpose types
70+
chat:
71+
auto_reply: true
72+
73+
tools:
74+
shellcheck:
75+
enabled: true
76+
markdownlint:
77+
enabled: true

0 commit comments

Comments
 (0)