-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy path.coderabbit.yml
More file actions
132 lines (121 loc) · 5.76 KB
/
Copy path.coderabbit.yml
File metadata and controls
132 lines (121 loc) · 5.76 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
128
129
130
131
132
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
# CodeRabbit review config. Mirrors the hard rules in AGENTS.md so the AI
# reviewer enforces project conventions on every PR.
language: en-US
tone_instructions: |
Be terse: at most three sentences per finding.
reviews:
profile: chill
request_changes_workflow: false
# Keep the bot's output to actionable inline comments only. Everything below
# is boilerplate CodeRabbit posts on every PR regardless of findings, which
# buries the few real comments and trains maintainers to skip them.
high_level_summary: false
changed_files_summary: false
sequence_diagrams: false
estimate_code_review_effort: false
assess_linked_issues: false
related_issues: false
related_prs: false
suggested_labels: false
suggested_reviewers: false
review_status: false
review_details: false
in_progress_fortune: false
poem: false
enable_prompt_for_ai_agents: false
collapse_walkthrough: true
pre_merge_checks:
docstrings:
mode: "off"
title:
mode: "off"
description:
mode: "off"
issue_assessment:
mode: "off"
finishing_touches:
docstrings:
enabled: false
unit_tests:
enabled: false
simplify:
enabled: false
autofix:
enabled: false
fix_ci:
enabled: false
resolve_merge_conflict:
enabled: false
auto_review:
enabled: true
# Review on PR open only; don't re-post a walkthrough on every push.
auto_incremental_review: false
drafts: false
# Skip generated, vendored, and immutable content so reviews stay focused.
path_filters:
- "!deps/**"
- "!data/sql/updates/db_*/**"
path_instructions:
- path: "**/*.{cpp,h,hpp}"
instructions: |
AzerothCore C++ conventions (CI enforces these with -Werror; flag violations):
- C++20. 4-space indent, tabs forbidden. UTF-8, LF, max 120 columns, trailing newline.
- Allman braces. No braces around single-line statements. `if (x)`, never `if(x)` or `if ( x )`.
- `auto const&` (not `const auto&`); `Type const*` (not `const Type*`).
- Use fmt-style `{}` format specifiers, never printf-style `%u`/`%s`.
- Logging: `LOG_INFO("category.sub", "msg {}", arg)` (also LOG_WARN/ERROR/DEBUG/TRACE).
No printf, no `sLog->`, no `TC_LOG_*`.
- Random: use Random.h helpers (urand, irand, frand, rand32, rand_chance,
roll_chance_f/i). Never `std::rand` or `<random>` directly.
- Strings: `Acore::StringFormat(fmt, args...)`.
- Config: `sConfigMgr->GetOption<T>("Name", default)`.
- Namespace is `Acore::` — flag any leftover `Trinity::` from upstream ports.
- Use typed helpers instead of raw flag access: IsPlayer()/IsCreature()/IsItem();
GetNpcFlags()/HasNpcFlag()/SetNpcFlag()/RemoveNpcFlag()/ReplaceAllNpcFlags();
IsRefundable()/IsBOPTradable()/IsWrapped(); HasFlag(ItemFlag)/HasFlag2()/HasFlagCu();
ObjectGuid::ToString().c_str() instead of GetCounter().
- Never store a raw Player*/Creature*/Unit* past the current call/tick — store the
ObjectGuid and resolve at use time (ObjectAccessor::FindPlayer,
ObjectAccessor::GetCreature(*from, guid), Map::GetCreature, …).
- DB access: use PreparedStatement, not raw query strings. Non-blocking reads go through
the async path (_queryProcessor.AddCallback(db.AsyncQuery(...))). Multi-statement
writes wrap in SQLTransaction.
- Timed AI actions: use EventMap or TaskScheduler, not hand-rolled tick counters.
- Prefer SmartAI (DB) for new creature behaviour; reach for CreatureScript only when the
SmartAI vocabulary isn't enough. New creature AI prefers RegisterCreatureAI(ClassName).
- Script registration: spell/aura scripts use RegisterSpellScript(ClassName) or
RegisterSpellAndAuraScriptPair(...) inside AddSC_(); creature AI uses
RegisterCreatureAI(ClassName) (preferred) or new ClassName() (legacy). Declare and
call AddSC_() from the regional loader (e.g. Spells/spells_script_loader.cpp,
EasternKingdoms/eastern_kingdoms_script_loader.cpp). Module hooks inherit from
PlayerScript/WorldScript/etc. and register with new MyClass() in AddSC_().
- path: "data/sql/updates/pending_db_*/**/*.sql"
instructions: |
AzerothCore SQL update conventions (enforced by apps/codestyle/codestyle-sql.py):
- Every INSERT must be preceded by a matching DELETE for idempotency, and that DELETE must include a WHERE clause scoped precisely to the intended rows. A predicate that is too broad will remove unrelated data, so confirm it matches exactly what the INSERT will re-add.
- 4-space indent (no tabs), trailing newline, no double semicolons, no multiple blank lines.
- Tables must use the InnoDB engine.
- path: "data/sql/base/**"
instructions: |
This SQL directory is immutable. Changes here should not happen in a normal PR —
flag any modification. New SQL belongs in data/sql/updates/pending_db_*/.
- path: "data/sql/archive/**"
instructions: |
This SQL directory is immutable. Changes here should not happen in a normal PR —
flag any modification. New SQL belongs in data/sql/updates/pending_db_*/.
tools:
# Prose linting on markdown produces capitalisation nits reported as review
# findings, each wrapped in a suggestion block and a raw linter dump.
languagetool:
enabled: false
knowledge_base:
code_guidelines:
enabled: true
# AGENTS.md is in CodeRabbit's defaults, but list it explicitly so the project's
# full guideline doc is always pulled into review context.
filePatterns:
- "AGENTS.md"
- ".agents/docs/code-review.md"
chat:
auto_reply: true