Skip to content

Commit c44adf7

Browse files
authored
feat: add coderabbit config (#73)
1 parent dd9eb35 commit c44adf7

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

packages/.coderabbit.yaml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
language: en-US # Set the language for reviews using ISO language code
2+
tone_instructions: "" # Custom instructions for review tone (max 250 chars)
3+
early_access: false # Disable early-access features
4+
enable_free_tier: false # Disable free tier features for users not on a paid plan
5+
reviews:
6+
profile: chill # Set review profile - 'chill' yields less nitpicky feedback than 'assertive'
7+
request_changes_workflow: false # Don't auto-approve when comments are resolved
8+
high_level_summary: true # Generate high level PR/MR summary in description
9+
high_level_summary_placeholder: "@coderabbitai summary" # Placeholder for high level summary
10+
high_level_summary_in_walkthrough: false # Don't include summary in walkthrough comment
11+
auto_title_placeholder: "@coderabbitai" # Keyword in PR/MR title for auto-generation
12+
auto_title_instructions: use conventional commit syntax for generating the title # Instructions for auto-title
13+
review_status: false # Don't post review details on each review
14+
commit_status: true # Set commit status during review progress
15+
fail_commit_status: false # Don't set failure status when review fails
16+
collapse_walkthrough: true # Generate walkthrough in collapsible section
17+
changed_files_summary: false # Don't generate changed files summary
18+
sequence_diagrams: false # Don't generate sequence diagrams
19+
assess_linked_issues: false # Don't assess linked issues
20+
related_issues: false # Don't include related issues
21+
related_prs: false # Don't include related PRs
22+
suggested_labels: false # Don't suggest labels
23+
auto_apply_labels: false # Don't auto-apply suggested labels
24+
suggested_reviewers: false # Don't suggest reviewers
25+
poem: false # Don't generate poems in walkthrough
26+
labeling_instructions: [] # No custom labeling instructions
27+
path_filters: # Glob patterns for files to include/exclude
28+
- "!dist/**, !node_modules/**" # Exclude dist and node_modules directories
29+
path_instructions:
30+
- path: "**/*.ts"
31+
instructions: |2-
32+
Review TypeScript files for adherence to the following guidelines:
33+
- Avoid over-abstraction; prioritize composition over inheritance.
34+
- Use dependency injection and follow SOLID principles.
35+
- Avoid `any`; use `unknown` when necessary.
36+
- Use runtime type-checking for environment variables (e.g., Zod).
37+
- Prevent circular dependencies with the internal module pattern.
38+
- Libraries should have an `external.ts` file explicitly listing public exports.
39+
- Use `bigint` as-is; cast to `Number` only when exposing values via APIs.
40+
- Document all code with JSDoc.
41+
- Encourage static async factory functions for constructors.
42+
- Avoid overly nitpicky feedback beyond these best practices.
43+
- path: "**/*.tsx"
44+
instructions: |2-
45+
Review `.tsx` files with these front-end best practices:
46+
- Avoid complex logic in the render section; abstract it into functions.
47+
- Maintain import order: React imports first, then libraries, then internal files.
48+
- Prefer logical AND (`&&`) over ternary conditionals for clarity.
49+
- Avoid inline styles; use external stylesheets or CSS-in-JS solutions.
50+
- Incorporate appropriate break lines for better readability.
51+
- Optimize images to be under 250kB for performance.
52+
- Follow React and team-specific standards for component structure and naming.
53+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
54+
- path: "**/services/**/*.ts"
55+
instructions: |-
56+
Review service files with the following considerations:
57+
- A Service encapsulates a broader business workflow and might orchestrate various components or interact with multiple data sources or APIs.
58+
- Ensure proper composability: Services should use Providers for data/resource access and apply business/orchestration logic.
59+
- Validate naming conventions for aggregating services (e.g., `AggregatorService` or domain-specific names like `MetricsService`).
60+
- path: scripts/**/*.ts
61+
instructions: |-
62+
Ensure scripts:
63+
- Use `process.cwd()` for root references.
64+
- Follow folder conventions (`infra/` for infra scripts, `utilities/` for utilities).
65+
- Are organized in `package.json` with `script:infra:{name}` or `script:util:{name}`.
66+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
67+
- path: "**/*.test.ts"
68+
instructions: |-
69+
Review the unit test files with the following guidelines:
70+
- Avoid using the word "should" in test descriptions.
71+
- Ensure descriptive test names convey the intent of each test.
72+
- Validate adherence to the Mocha/Chai/Jest/Vitest/Cypress test library best practices.
73+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
74+
- path: "**/*.spec.ts"
75+
instructions: |-
76+
Review the unit test files with the following guidelines:
77+
- Avoid using the word "should" in test descriptions.
78+
- Ensure descriptive test names convey the intent of each test.
79+
- Validate adherence to the Mocha/Chai/Jest test library best practices.
80+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
81+
- path: "**/*.js"
82+
instructions: |2-
83+
Review JavaScript files for:
84+
- Compliance with the Google JavaScript Style Guide.
85+
- Dependency management without caret versions.
86+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
87+
- path: "**/errors/**/*.ts"
88+
instructions: |2-
89+
Ensure custom error classes:
90+
- Have declarative, descriptive names.
91+
- Avoid suffixes like `Exception` or `Error` (e.g., use `EmptyArray`).
92+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
93+
- path: "**/providers/**/*.ts"
94+
instructions: >-
95+
Review provider files for the following:
96+
- Providers should supply narrowly scoped data/resources.
97+
- Ensure classes interacting with metadata sources (e.g., GitHub, JSON
98+
files, IPFS) implement the `IMetadataProvider` interface and follow
99+
naming conventions (e.g., `GithubProvider`, `JsonFileProvider`).
100+
- Be concise and avoid overly nitpicky feedback outside of these best practices.
101+
abort_on_close: true # Stop review if PR/MR is closed/merged
102+
auto_review:
103+
enabled: true # Enable automatic code review
104+
auto_incremental_review: true # Enable review on each push
105+
ignore_title_keywords: [] # No keywords to ignore in PR titles
106+
labels: [] # No label restrictions for auto-review
107+
drafts: true # Review draft PRs/MRs
108+
base_branches: [] # Only review default branch
109+
finishing_touches:
110+
docstrings:
111+
enabled: true # Allow generating docstrings
112+
tools: # Configuration for various code analysis tools
113+
shellcheck:
114+
enabled: true # Enable ShellCheck for shell script analysis
115+
markdownlint:
116+
enabled: true # Enable markdownlint for Markdown files
117+
github-checks:
118+
enabled: true # Enable GitHub Checks integration
119+
timeout_ms: 300000 # Wait up to 5 minutes for GitHub Workflow checks
120+
languagetool:
121+
enabled: true # Enable LanguageTool for grammar checking
122+
enabled_only: false # Don't restrict to only enabled rules
123+
level: default # Use default strictness level
124+
enabled_rules: [] # No specific rules enabled
125+
disabled_rules: [] # No specific rules disabled
126+
enabled_categories: [] # No specific categories enabled
127+
disabled_categories: [] # No specific categories disabled
128+
biome:
129+
enabled: true # Enable Biome for web project analysis
130+
hadolint:
131+
enabled: true # Enable Hadolint for Dockerfile linting
132+
yamllint:
133+
enabled: true # Enable YAMLlint for YAML files
134+
gitleaks:
135+
enabled: true # Enable Gitleaks for secret scanning
136+
checkov:
137+
enabled: true # Enable Checkov for IaC analysis
138+
eslint:
139+
enabled: true # Enable ESLint for JavaScript
140+
actionlint:
141+
enabled: true # Enable actionlint for GitHub Actions
142+
semgrep:
143+
enabled: true # Enable Semgrep for security scanning
144+
circleci:
145+
enabled: true # Enable CircleCI config checker
146+
ast-grep:
147+
packages: [] # No predefined packages
148+
rule_dirs: [] # No custom rule directories
149+
util_dirs: [] # No custom util directories
150+
essential_rules: true # Use essential rules package
151+
chat:
152+
auto_reply: true # Enable automatic bot replies
153+
integrations:
154+
linear:
155+
usage: enabled # Enable Linear
156+
knowledge_base:
157+
opt_out: false # Don't opt out of knowledge base features
158+
web_search:
159+
enabled: true # Enable web search integration
160+
learnings:
161+
scope: auto # Auto-select learnings scope based on repo visibility
162+
issues:
163+
scope: auto # Auto-select issues scope based on repo visibility
164+
linear:
165+
usage: enabled # Enable Linear
166+
team_keys: ["GIT"] # Linear team key
167+
pull_requests:
168+
scope: auto # Auto-select PR scope based on repo visibility

0 commit comments

Comments
 (0)