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
212 changes: 212 additions & 0 deletions .github/coderabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# CodeRabbit Configuration for NickSpace Playground
# https://docs.coderabbit.ai/configuration-file

# Language settings
language: en-US

# Review settings
reviews:
# Enable/disable auto reviews
auto_review: true

# Draft PR reviews
draft_as_pending: true

# Review scope
review:
# Files to review
include:
- "**/*.js"
- "**/*.jsx"
- "**/*.ts"
- "**/*.tsx"
- "**/*.css"
- "**/*.scss"
- "**/*.json"
- "**/*.md"
- "**/*.yml"
- "**/*.yaml"

# Files to exclude from review
exclude:
- "node_modules/**"
- "build/**"
- "dist/**"
- "coverage/**"
- "*.min.js"
- "*.bundle.js"
- "package-lock.json"
- "yarn.lock"

# Auto-approve changes to these files
auto_approve:
- "README.md" # documentation updates
- "CHANGELOG.md"

# Require manual approval for these critical files
require_manual_approval:
- "src/App.js"
- ".github/**"
- "public/index.html"
- "CLAUDE.md"

# Code quality rules
rules:
# JavaScript/React specific rules
javascript:
# Performance
- check_unused_variables: true
- check_console_logs: warn
- check_debugger_statements: error
- suggest_const_over_let: true

# React specific
- check_react_hooks_dependencies: true
- suggest_react_memo: true
- check_jsx_key_props: true
- suggest_functional_components: true

# General code quality
- max_function_length: 50
- max_file_length: 500
- suggest_early_returns: true
- check_duplicate_code: true

# CSS specific rules
css:
- check_unused_styles: true
- suggest_css_variables: true
- check_responsive_units: true
- prefer_flexbox_grid: true

# Security rules
security:
- check_hardcoded_secrets: error
- check_vulnerable_dependencies: warn
- check_unsafe_html: error

# Comment settings
comments:
# Comment behavior
tone: friendly
max_comments_per_review: 15

# Focus areas for comments
focus_areas:
- performance
- security
- maintainability
- accessibility
- best_practices
- code_style

# Specific comment types
suggest:
- performance_improvements: true
- accessibility_improvements: true
- code_simplification: true
- better_naming: true
- error_handling: true

# Don't comment on these (auto-fix instead)
auto_fix:
- formatting
- simple_typos
- missing_semicolons
- trailing_whitespace

# Project-specific settings
project:
# Framework detection
framework: react

# Build tools
build_tools:
- npm
- create-react-app

# Testing framework
testing_framework: jest

# Deployment
deployment_platform: github_pages

# Integration settings
integrations:
# GitHub settings
github:
# PR title suggestions
suggest_pr_titles: true

# Auto-assign reviewers based on file changes
auto_assign_reviewers:
- "src/components/GameTheory/**": ["@game-theory-expert"]
- "src/components/Pathfinding/**": ["@algorithms-expert"]
- "src/components/IncomeTax/**": ["@finance-expert"]
- "**/*.css": ["@ui-ux-expert"]

Comment on lines +141 to +147
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify auto_assign_reviewers format.

YAML is valid, but confirm CodeRabbit expects a mapping vs list-of-single-key maps for this field.

Run a web check:


🌐 Web query:

Show the correct schema and example for `auto_assign_reviewers` in CodeRabbit's `.coderabbit.yml` / `.github/coderabbit.yml` configuration.

💡 Result:

Schema (field path + type + default)

  • reviews.auto_assign_reviewers: boolean — default: false. [1][2]

Minimal examples

.coderabbit.yml or .github/coderabbit.yml

# enable suggested reviewers and auto-assign them
reviews:
  suggested_reviewers: true
  auto_assign_reviewers: true

Fuller context example

reviews:
  profile: "chill"
  suggested_reviewers: true
  auto_assign_reviewers: true
  auto_apply_labels: false
  auto_review:
    enabled: true
    drafts: false

Sources

  • Configuration reference (reviews section). [1]
  • YAML template / examples. [2]

Configure reviews.auto_assign_reviewers as a boolean
Replace the mapping in .github/coderabbit.yml lines 142–148 with:

reviews:
  suggested_reviewers: true
  auto_assign_reviewers: true

CodeRabbit only supports auto_assign_reviewers as a boolean flag, not a file‐pattern map.

🤖 Prompt for AI Agents
In .github/coderabbit.yml around lines 142 to 148, the current
auto_assign_reviewers mapping using file patterns is invalid; CodeRabbit expects
a boolean flag. Replace the pattern map with a reviews block that sets
suggested_reviewers: true and auto_assign_reviewers: true, removing the
file-pattern entries entirely so the config uses the supported boolean flag.

# PR labels
auto_labels:
- path: "src/components/**/*.js"
labels: ["frontend", "react"]
- path: "**/*.css"
labels: ["styling", "ui"]
- path: "**/*.md"
labels: ["documentation"]
- path: ".github/**"
labels: ["ci/cd", "config"]
- path: "src/components/IncomeTax/**"
labels: ["feature", "calculator"]

# Custom rules for this project
custom_rules:
# Educational project specific rules
- name: "educational_clarity"
description: "Ensure code is educational and well-documented"
pattern: "src/components/**/*.js"
checks:
- has_component_description: warn
- has_prop_types: suggest
- has_usage_examples: suggest

# Calculator specific rules
- name: "calculator_accuracy"
description: "Ensure calculator components have proper validation"
pattern: "src/components/*Calculator/**/*.js"
checks:
- has_input_validation: error
- has_error_handling: error
- has_boundary_testing: warn

Comment on lines +161 to +180
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Fix custom_rules pattern so it matches IncomeTaxCalculator.js.

Pattern "src/components/Calculator/**/.js" targets folders ending with "Calculator", not files like IncomeTaxCalculator.js. As a result, accuracy/validation checks won’t run on this component.

Apply this diff:

   - name: "calculator_accuracy"
     description: "Ensure calculator components have proper validation"
-    pattern: "src/components/*Calculator/**/*.js"
+    pattern: "src/components/**/*Calculator*.js"
     checks:
       - has_input_validation: error
       - has_error_handling: error
       - has_boundary_testing: warn
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Custom rules for this project
custom_rules:
# Educational project specific rules
- name: "educational_clarity"
description: "Ensure code is educational and well-documented"
pattern: "src/components/**/*.js"
checks:
- has_component_description: warn
- has_prop_types: suggest
- has_usage_examples: suggest
# Calculator specific rules
- name: "calculator_accuracy"
description: "Ensure calculator components have proper validation"
pattern: "src/components/*Calculator/**/*.js"
checks:
- has_input_validation: error
- has_error_handling: error
- has_boundary_testing: warn
# Custom rules for this project
custom_rules:
# Educational project specific rules
- name: "educational_clarity"
description: "Ensure code is educational and well-documented"
pattern: "src/components/**/*.js"
checks:
- has_component_description: warn
- has_prop_types: suggest
- has_usage_examples: suggest
# Calculator specific rules
- name: "calculator_accuracy"
description: "Ensure calculator components have proper validation"
pattern: "src/components/**/*Calculator*.js"
checks:
- has_input_validation: error
- has_error_handling: error
- has_boundary_testing: warn
🤖 Prompt for AI Agents
.github/coderabbit.yml around lines 162 to 181: the glob pattern
"src/components/*Calculator/**/*.js" only matches directories whose name ends
with "Calculator" and nested files, so it misses files named like
IncomeTaxCalculator.js; update the pattern to match files with "Calculator" in
their filename (for example use "src/components/**/*Calculator.js" or
"src/components/**/*Calculator*.js") so the calculator_accuracy checks will run
against IncomeTaxCalculator.js (apply the chosen glob to replace the existing
pattern).

# Performance rules for interactive components
- name: "interactive_performance"
description: "Ensure interactive components are optimized"
pattern: "src/components/**/*.js"
checks:
- uses_react_memo_when_needed: suggest
- uses_callback_for_handlers: suggest
- minimal_re_renders: warn

# Notification settings
notifications:
# When to notify
events:
- review_completed
- high_priority_issues
- security_vulnerabilities

# Notification channels (customize based on your setup)
channels:
- github_comments
- github_reviews

# Learning and improvement
learning:
# Track improvement over time
track_metrics: true

# Suggest learning resources
suggest_resources: true

# Focus on educational value since this is a playground project
educational_mode: true
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Home from "./Home";
import Pathfinding from "./Pathfinding";
import GameTheory from "./components/GameTheory/GameTheory";
import ProjectCalculator from "./ProjectCalculator";
import IncomeTaxCalculator from "./components/IncomeTax/IncomeTaxCalculator";
import Algo from './components/AlgoAndDs/AlgoAndDs';
import './App.css';

Expand All @@ -15,6 +16,7 @@ function App() {
<Route path="pathfinding" element={<Pathfinding />} />
<Route path="game-theory" element={<GameTheory />} />
<Route path="project-calculator" element={<ProjectCalculator />} />
<Route path="income-tax" element={<IncomeTaxCalculator />} />
<Route path="algo-ds" element={<Algo />} />
</Routes>
</div>
Expand Down
Loading