-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
127 lines (112 loc) · 4.39 KB
/
.coderabbit.yaml
File metadata and controls
127 lines (112 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# CodeRabbit Configuration for okp-mcp
# Docs: https://docs.coderabbit.ai/configuration/
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: en-US
tone_instructions: >
You are a brilliant but world-weary senior developer who has seen too much.
Deliver feedback with dry wit and gentle sarcasm, but always be helpful.
Use programming puns when the opportunity arises.
reviews:
profile: chill
collapse_walkthrough: false
poem: false
request_changes_workflow: true
high_level_summary: false
high_level_summary_placeholder: "@coderabbitai summary"
abort_on_close: true
review_status: true
suggested_labels: false
suggested_reviewers: false
in_progress_fortune: false
pre_merge_checks:
title:
mode: "off"
docstrings:
mode: warning
threshold: 80
description:
mode: warning
auto_review:
enabled: true
drafts: false
auto_pause_after_reviewed_commits: 0
base_branches:
- main
ignore_title_keywords:
- "WIP"
- "[WIP]"
- "DO NOT MERGE"
path_filters:
- "!**/__pycache__/**"
- "!**/.venv/**"
- "!**/.pytest_cache/**"
- "!**/.ruff_cache/**"
- "!**/dist/**"
- "!**/*.egg-info/**"
- "!**/htmlcov/**"
- "!**/.coverage"
- "!**/uv.lock"
path_instructions:
- path: "src/**/*.py"
instructions: |
Focus on security and correctness:
- All Solr queries must use parameterized values, not string interpolation
- Verify async/await patterns (no blocking calls in async functions)
- httpx calls must use AsyncClient as context manager with timeouts
- Ensure proper exception handling: httpx.TimeoutException and httpx.HTTPError separately
- Error messages must be clear enough for LLMs to understand and act on
- Return user-friendly strings on failure (not exceptions) for MCP tools
- Verify MCP tool functions are async
- Check pydantic model usage (BaseSettings, Field with descriptions)
- All functions must have cyclomatic complexity A or B (C+ fails CI)
- Don't nitpick style (ruff handles) or types (ty validates)
- path: "src/**/config.py"
instructions: |
Configuration validation:
- Centralize derived config logic (defaults, path resolution) in config class
- Use pydantic BaseSettings with MCP_ env prefix
- Validate environment variables at startup, not lazily
- Use @computed_field for derived values
- Check for secure defaults
- path: "src/**/tools.py"
instructions: |
MCP tool definitions:
- All tool functions must be async
- Return user-friendly strings on failure, not exceptions
- Use specific exception types (httpx.TimeoutException, not bare Exception)
- Log exceptions with logger.exception() for stack traces
- Log warnings with logger.warning() for expected failures (timeouts)
- Verify input validation before constructing Solr queries
- path: "tests/**/*.py"
instructions: |
Focus on test quality and meaningfulness:
- Tests should verify behavior, not just chase coverage
- Use respx for HTTP mocking (not responses or aioresponses)
- Prefer parameterized tests over duplicate test functions
- Mock specs should be provided where applicable
- Use pytest.raises with nullcontext() pattern, not boolean flags
- Use fixtures for reusable test components, not helper functions
- Async tests run without @pytest.mark.asyncio (asyncio_mode = "auto")
- Don't nitpick coverage percentages
- path: "pyproject.toml"
instructions: |
Check dependency versions and configuration consistency.
Dev tools: uv (package manager), ruff (linting/formatting), ty (type checking), pytest (testing), radon (complexity).
- path: ".github/workflows/**"
instructions: "Validate workflow syntax and security (no secrets in logs)"
- path: "Makefile"
instructions: |
Makefile validation:
- .PHONY declarations for all non-file targets
- Avoid flags that are already defaults
- path: "Containerfile"
instructions: "Use Podman + Containerfile conventions (not Docker + Dockerfile)"
chat:
auto_reply: true
knowledge_base:
learnings:
scope: global
code_guidelines:
enabled: true
filePatterns:
- "**/AGENTS.md"