Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 236 additions & 0 deletions .coderabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
# 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

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:
- "!**/node_modules/**" # npm dependencies
- "!**/android/**" # Native Android build files
- "!**/ios/**" # Native iOS build files
- "!**/.expo/**" # Expo build cache
- "!**/.expo-shared/**" # Expo shared config
- "!**/dist/**" # Build output

# Use the following tools when reviewing
tools:
shellcheck:
enabled: true
ruff:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_only: false
level: default
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
checkov:
enabled: true
detekt:
enabled: true
eslint:
enabled: true

# Apply the following labels to PRs
labeling_instructions:
- label: Python Lang
instructions: Apply when the PR/MR contains changes to python source-code
- label: Solidity Lang
instructions: Apply when the PR/MR contains changes to solidity source-code
- label: Typescript Lang
instructions: Apply when the PR/MR contains changes to javascript or typescript source-code
- label: Ergoscript Lang
instructions: Apply when the PR/MR contains changes to ergoscript 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
- 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:
# TypeScript/JavaScript files
- path: "**/*.{ts,tsx,js,jsx}"
instructions: |
NextJS:
- Ensure that "use client" is being used
- Ensure that only features that allow pure client-side rendering are used
- NextJS best practices (including file structure, API routes, and static generation methods) are used.

TypeScript:
- Avoid 'any', use explicit types
- Prefer 'import type' for type imports
- Review for significant deviations from Google JavaScript style guide. Minor style issues are not a priority
- The code adheres to best practices associated with React
- The code adheres to best practices associated with React PWA
- The code adheres to best practices associated with SPA
- The code adheres to best practices recommended by lighthouse or similar tools for performance
- The code adheres to best practices associated with Node.js
- The code adheres to best practices recommended for performance

Security:
- No exposed API keys or sensitive data
- Use expo-secure-store for sensitive storage
- Validate deep linking configurations
- Check for common security vulnerabilities such as:
- SQL Injection
- XSS (Cross-Site Scripting)
- CSRF (Cross-Site Request Forgery)
- Insecure dependencies
- Sensitive data exposure

Internationalization:
- User-visible strings should be externalized to resource files (i18n)

# HTML files
- path: "**/*.html"
instructions: |
Review the HTML code against the google html style guide and point out any mismatches. Ensure that:
- The code adheres to best practices recommended by lighthouse or similar tools for performance

# CSS files
- path: "**/*.css"
instructions: |
Review the CSS code against the google css style guide and point out any mismatches. Ensure that:
- The code adheres to best practices associated with CSS.
- The code adheres to best practices recommended by lighthouse or similar tools for performance.
- The code adheres to similar naming conventions for classes, ids.

# Python files
- path: "**/*.{py}"
instructions: |
Python:
- Check for major PEP 8 violations and Python best practices.

# Solidity Smart Contract files
- path: "**/*.sol"
instructions: |
Solidity:
- Review the Solidity contracts for security vulnerabilities and best practices
- Ensure that the contracts are immutable
- Ensure that there no unbounded loops that may run out of gas
- Use appropriate visibility modifiers
- flag variables that are defined and used only once
- Look for gas optimization opportunities

# Javascript/Typescript test files
- path: "**/*.test.{ts,tsx,js,jsx}"
instructions: |
Review test files for:
- Comprehensive coverage of component behavior
- Proper use of @testing-library/react-native
- Async behavior is properly tested
- Accessibility testing is included
- Test descriptions are sufficiently detailed to clarify the purpose of each test
- The tests are not tautological

# Solidity test files
- path: "**/*.test.{sol}"
instructions: |
Review test files for:
- Comprehensive coverage of contract behavior

# Asset files (images, fonts, etc.)
- path: "assets/**/*"
instructions: |
Review asset files for:
- Image optimization (appropriate size and format)
- Proper @2x and @3x variants for different screen densities
- SVG assets are optimized
- Font files are licensed and optimized
Loading