|
| 1 | +# ======================================================= |
| 2 | +# CodeRabbit AI Review Configuration |
| 3 | +# For Laravel + JS projects |
| 4 | +# Reference: https://docs.coderabbit.ai/config |
| 5 | +# ======================================================= |
| 6 | + |
| 7 | +language: en-US |
| 8 | + |
| 9 | +reviews: |
| 10 | + # Review tone — defines style of feedback |
| 11 | + # Options: assertive | chill | friendly | strict | concise | detailed |
| 12 | + profile: assertive |
| 13 | + |
| 14 | + # Require resolution before merge |
| 15 | + request_changes_workflow: true |
| 16 | + |
| 17 | + # Include an AI summary of the PR |
| 18 | + high_level_summary: false |
| 19 | + |
| 20 | + # Report check status to GitHub UI |
| 21 | + review_status: false |
| 22 | + commit_status: false |
| 23 | + fail_commit_status: false |
| 24 | + |
| 25 | + # Scope review to the app's own PHP source and its tests. Everything |
| 26 | + # else (Blade/JS/CSS assets, vendor lockfiles, CI/tooling config, |
| 27 | + # generated artifacts, docs) is noise for a Laravel PR review and |
| 28 | + # inflates the reviewed-file count without adding review value. |
| 29 | + path_filters: |
| 30 | + - '!vendor/**' |
| 31 | + - '!node_modules/**' |
| 32 | + - '!public/**' |
| 33 | + - '!storage/**' |
| 34 | + - '!bootstrap/cache/**' |
| 35 | + - '!resources/assets/**' |
| 36 | + - '!resources/views/**' |
| 37 | + - '!*.md' |
| 38 | + - '!**/*.md' |
| 39 | + - '!yarn.lock' |
| 40 | + - '!package-lock.json' |
| 41 | + - '!composer.lock' |
| 42 | + - '!.github/**' |
| 43 | + - '!.claude/**' |
| 44 | + - '!.junie/**' |
| 45 | + - 'app/**/*.php' |
| 46 | + - 'tests/**/*.php' |
| 47 | + - 'database/**/*.php' |
| 48 | + - 'routes/**/*.php' |
| 49 | + - 'config/**/*.php' |
| 50 | + |
| 51 | + path_instructions: |
| 52 | + - path: 'app/**/*.php' |
| 53 | + instructions: | |
| 54 | + This is Laravel application code. Prioritize: |
| 55 | + - Missing or inconsistent authorization checks (controller |
| 56 | + constructor middleware, FormRequest::authorize(), and route |
| 57 | + middleware are all valid enforcement points — check all three |
| 58 | + before flagging something as unauthorized). |
| 59 | + - Mass assignment via fill($request->all()) instead of validated() |
| 60 | + or explicit field lists. |
| 61 | + - N+1 queries and missing eager loading, especially in anything |
| 62 | + feeding a DataTables/index endpoint. |
| 63 | + - Raw Eloquent models or user input echoed into Blade/JSON without |
| 64 | + escaping. |
| 65 | + - path: 'tests/**/*.php' |
| 66 | + instructions: | |
| 67 | + Each test method must start with `it_` and read as a sentence, |
| 68 | + annotated with #[Test] (never a `test_` prefix). Flag tests that |
| 69 | + don't follow Arrange/Act/Assert structure, that depend on shared |
| 70 | + seeded state instead of factories, or that assert only the happy |
| 71 | + path for something security-relevant. |
| 72 | +
|
| 73 | + # --- collapsible: UI / Fun / Optional ------------------------------------------------ |
| 74 | + collapse_walkthrough: false |
| 75 | + sequence_diagrams: false |
| 76 | + estimate_code_review_effort: true |
| 77 | + in_progress_fortune: false |
| 78 | + poem: false |
| 79 | + # ------------------------------------------------------------------------------------ |
| 80 | + |
| 81 | + auto_review: |
| 82 | + enabled: false |
| 83 | + auto_incremental_review: true |
| 84 | + # --- collapsible: customization ---------------------------------------------------- |
| 85 | + ignore_title_keywords: ['WIP', 'draft'] |
| 86 | + labels: ['needs-review'] |
| 87 | + drafts: false |
| 88 | + base_branches: ['master', 'development'] |
| 89 | + ignore_usernames: ['dependabot', 'renovate'] |
| 90 | + # ------------------------------------------------------------------------------------ |
| 91 | + |
| 92 | + # --- collapsible: doc/test auto-suggestions ------------------------------------------ |
| 93 | + finishing_touches: |
| 94 | + docstrings: |
| 95 | + enabled: false |
| 96 | + unit_tests: |
| 97 | + enabled: false |
| 98 | + # ------------------------------------------------------------------------------------ |
| 99 | + |
| 100 | + # --- collapsible: pre-merge quality gates -------------------------------------------- |
| 101 | + pre_merge_checks: |
| 102 | + docstrings: |
| 103 | + mode: warning |
| 104 | + threshold: 80 |
| 105 | + title: |
| 106 | + mode: warning |
| 107 | + requirements: 'Descriptive, mentions component or ticket' |
| 108 | + description: |
| 109 | + mode: warning |
| 110 | + # ------------------------------------------------------------------------------------ |
| 111 | + |
| 112 | +tools: |
| 113 | + # --- Core linters for Laravel (PHP) and JS ------------------------------------------- |
| 114 | + phpstan: |
| 115 | + enabled: true |
| 116 | + level: "3" |
| 117 | + phpcs: |
| 118 | + enabled: true |
| 119 | + eslint: |
| 120 | + enabled: true |
| 121 | + markdownlint: |
| 122 | + enabled: true |
| 123 | + |
| 124 | + # --- collapsible: supporting & infra tools ------------------------------------------- |
| 125 | + shellcheck: |
| 126 | + enabled: false |
| 127 | + hadolint: |
| 128 | + enabled: false |
| 129 | + yamllint: |
| 130 | + enabled: false |
| 131 | + dotenvLint: |
| 132 | + enabled: false |
| 133 | + htmlhint: |
| 134 | + enabled: false |
| 135 | + semgrep: |
| 136 | + enabled: false |
| 137 | + gitleaks: |
| 138 | + enabled: false |
| 139 | + osvScanner: |
| 140 | + enabled: false |
| 141 | + actionlint: |
| 142 | + enabled: true |
| 143 | + # ------------------------------------------------------------------------------------ |
| 144 | + |
| 145 | +chat: |
| 146 | + # --- collapsible: personality + integrations ----------------------------------------- |
| 147 | + art: false |
| 148 | + auto_reply: true |
| 149 | + integrations: |
| 150 | + jira: |
| 151 | + usage: disabled |
| 152 | + linear: |
| 153 | + usage: disabled |
| 154 | + # ------------------------------------------------------------------------------------ |
| 155 | + |
| 156 | +# --- collapsible: AI learning + docs integration --------------------------------------- |
| 157 | +knowledge_base: |
| 158 | + opt_out: true |
| 159 | + web_search: |
| 160 | + enabled: false |
| 161 | + code_guidelines: |
| 162 | + enabled: false |
| 163 | + filePatterns: ['CONTRIBUTING.md', 'docs/code-guidelines.md'] |
| 164 | + learnings: |
| 165 | + scope: global |
| 166 | + issues: |
| 167 | + scope: global |
| 168 | + pull_requests: |
| 169 | + scope: global |
| 170 | +# --------------------------------------------------------------------------------------- |
| 171 | + |
| 172 | +# --- collapsible: AI code generation suggestions --------------------------------------- |
| 173 | +code_generation: |
| 174 | + docstrings: |
| 175 | + language: en-US |
| 176 | + |
| 177 | + unit_tests: |
| 178 | + # Instructions for AI-generated unit tests |
| 179 | + path_instructions: |
| 180 | + - path: 'tests/Unit/**' |
| 181 | + instructions: | |
| 182 | + Each test method must begin with `it_` and is in snake_case. |
| 183 | + Annotate each test method with `#[Test]`. |
| 184 | + Each test method must contain `$this->markTestIncomplete();` by default. |
| 185 | + Prefer Fakes and Fixtures over Mocks. |
| 186 | + Structure tests with `it_` functions and place happy paths last. |
| 187 | + Reusable logic (e.g., fixtures) must reside in an abstract test case. |
| 188 | + - path: 'tests/Feature/**' |
| 189 | + instructions: | |
| 190 | + Each test method must begin with `it_` and is in snake_case. |
| 191 | + Annotate each test method with `#[Test]`. |
| 192 | + Default to `$this->markTestIncomplete();` until test logic is finalized. |
| 193 | + Use Laravel's HTTP helpers (`->postJson()`, `->getJson()`, etc.). |
| 194 | + Avoid inline fixture setup; use factories and seeders. |
| 195 | +# --------------------------------------------------------------------------------------- |
0 commit comments