Revising AI review instructions: * Reduce context window use for AI review tools, by avoiding repeating common knowledge and API information that is (usually) part of the AI training datasets any way. * Introduce a mechanism to maintain both parts in single files, to avoid "silent diversion" over time * Adding a coderabbit path instruction that ensures cross-checking of both parts whenever a PR modifies instruction files Objectives: * Primary Goal: only inject content in AI-visible areas that are WLED-MM–specific or which deviate from general knowledge (the context window "token cost" of true false-positive suppressors is always worth it). * Soft goal: keep each file's AI-facing section lean enough that the signal-to-noise ratio in the attention layer stays high — around 1,500–2,000 words per file type is a reasonable practical ceiling for current models. * Aspirational: 500 words per file if achievable without sacrificing review quality. This is an evolution of #353, based on the discussion in https://github.com/MoonModules/WLED-MM/pull/353#issuecomment-4186989873 --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
84 lines
4.5 KiB
YAML
84 lines
4.5 KiB
YAML
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
|
|
#
|
|
# CodeRabbit configuration — references existing guideline files to avoid
|
|
# duplicating conventions. See:
|
|
# .github/copilot-instructions.md — project overview & general rules
|
|
# .github/cpp.instructions.md — C++ coding conventions
|
|
# .github/web.instructions.md — Web UI coding conventions
|
|
# .github/cicd.instructions.md — GitHub Actions / CI-CD conventions
|
|
# .github/esp-idf.instructions.md — ESP-IDF / chip-specific coding guidelines
|
|
# (apply when code directly uses ESP-IDF APIs:
|
|
# esp_idf_*, I2S, RMT, ADC, GPIO, heap_caps, etc.)
|
|
#
|
|
# NOTE: This file must be committed (tracked by git) for CodeRabbit to read
|
|
# it from the repository. If it is listed in .gitignore, CodeRabbit will
|
|
# not see it and these settings will have no effect.
|
|
|
|
language: en-US
|
|
|
|
reviews:
|
|
path_instructions:
|
|
- path: "**/*.{cpp,h,hpp,ino}"
|
|
instructions: >
|
|
Follow the C++ coding conventions documented in .github/cpp.instructions.md
|
|
and the general project guidelines in .github/copilot-instructions.md.
|
|
If the code under review directly uses ESP-IDF APIs (e.g. heap_caps_malloc,
|
|
I2S, RMT, ADC, GPIO, esp_timer, or any esp_idf_* / soc_* symbols), also
|
|
apply the guidelines in .github/esp-idf.instructions.md.
|
|
|
|
Key rules: 2-space indentation (no tabs), camelCase functions/variables,
|
|
PascalCase classes, UPPER_CASE macros. Mark WLED-MM-specific changes with
|
|
`// WLEDMM` comments. No C++ exceptions — use return codes and debug macros.
|
|
|
|
Hot-path optimization guidelines (attributes, uint_fast types, caching,
|
|
unsigned range checks) apply from pixel set/get operations downward —
|
|
NOT to effect functions in FX.cpp, which have diverse contributor styles.
|
|
|
|
- path: "wled00/data/**"
|
|
instructions: >
|
|
Follow the web UI conventions documented in .github/web.instructions.md.
|
|
|
|
Key rules: indent HTML and JavaScript with tabs, CSS with tabs or spaces.
|
|
Files here are built into wled00/html_*.h by tools/cdata.js — never
|
|
edit those generated headers directly.
|
|
|
|
- path: "wled00/html_*.h"
|
|
instructions: >
|
|
These files are auto-generated from wled00/data/ by tools/cdata.js.
|
|
They must never be manually edited or committed. Flag any PR that
|
|
includes changes to these files.
|
|
|
|
- path: "usermods/**"
|
|
instructions: >
|
|
Usermods are community add-ons following the upstream WLED 0.15.x style.
|
|
Each usermod lives in its own directory under usermods/ and is implemented
|
|
as a .h file that is pulled in by wled00/usermods_list.cpp (guarded by
|
|
#ifdef). Usermods do not use library.json. Follow the same C++ conventions
|
|
as the core firmware (.github/cpp.instructions.md).
|
|
|
|
- path: ".github/workflows/*.{yml,yaml}"
|
|
instructions: >
|
|
Follow the CI/CD conventions documented in .github/cicd.instructions.md.
|
|
|
|
Key rules: 2-space indentation, descriptive name: on every workflow/job/step.
|
|
Third-party actions must be pinned to a specific version tag — branch pins
|
|
such as @main or @master are not allowed. Declare explicit permissions: blocks
|
|
scoped to least privilege. Never interpolate github.event.* values directly
|
|
into run: steps — pass them through an env: variable to prevent script
|
|
injection. Do not use pull_request_target unless fully justified.
|
|
|
|
- path: ".github/*.instructions.md"
|
|
instructions: |
|
|
This file contains both AI-facing rules and human-only reference sections.
|
|
Human-only sections are enclosed in `<!-- HUMAN_ONLY_START -->` /
|
|
`<!-- HUMAN_ONLY_END -->` HTML comment markers and should not be used as
|
|
actionable review criteria.
|
|
|
|
When this file is modified in a PR, perform the following alignment check:
|
|
1. For each `<!-- HUMAN_ONLY_START --> ... <!-- HUMAN_ONLY_END -->` block,
|
|
verify that its examples and guidance are consistent with (and do not
|
|
contradict) the AI-facing rules stated in the same file.
|
|
2. Flag any HUMAN_ONLY section whose content has drifted from the surrounding
|
|
AI-facing rules due to edits introduced in this PR.
|
|
3. If new AI-facing rules were added without updating a related HUMAN_ONLY
|
|
reference section, note this as a suggestion (not a required fix). |