From 64529bbd84aa923f739c9e59471d756a8ddedf37 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 19:02:20 +0200 Subject: [PATCH] chore: move coding guidelines from .github to docs/ (#358) * Reorganized repository documentation and updated internal configuration to reference the new docs location. Documentation * Updated contributor and instruction guides to point to the relocated documentation files so links and references remain correct. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: softhack007 <91616163+softhack007@users.noreply.github.com> --- .coderabbit.yaml | 22 +++++++++++----------- .github/copilot-instructions.md | 4 +++- CONTRIBUTING.md | 6 +++--- {.github => docs}/cicd.instructions.md | 0 {.github => docs}/cpp.instructions.md | 0 {.github => docs}/esp-idf.instructions.md | 0 {.github => docs}/web.instructions.md | 0 7 files changed, 17 insertions(+), 15 deletions(-) rename {.github => docs}/cicd.instructions.md (100%) rename {.github => docs}/cpp.instructions.md (100%) rename {.github => docs}/esp-idf.instructions.md (100%) rename {.github => docs}/web.instructions.md (100%) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 5dbb79d2..b8fbfecb 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -3,10 +3,10 @@ # 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 +# docs/cpp.instructions.md — C++ coding conventions +# docs/web.instructions.md — Web UI coding conventions +# docs/cicd.instructions.md — GitHub Actions / CI-CD conventions +# docs/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.) # @@ -20,11 +20,11 @@ reviews: path_instructions: - path: "**/*.{cpp,h,hpp,ino}" instructions: > - Follow the C++ coding conventions documented in .github/cpp.instructions.md + Follow the C++ coding conventions documented in docs/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. + apply the guidelines in docs/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 @@ -36,7 +36,7 @@ reviews: - path: "wled00/data/**" instructions: > - Follow the web UI conventions documented in .github/web.instructions.md. + Follow the web UI conventions documented in docs/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 @@ -54,11 +54,11 @@ reviews: 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). + as the core firmware (docs/cpp.instructions.md). - path: ".github/workflows/*.{yml,yaml}" instructions: > - Follow the CI/CD conventions documented in .github/cicd.instructions.md. + Follow the CI/CD conventions documented in docs/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 @@ -67,7 +67,7 @@ reviews: 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" + - path: "**/*.instructions.md" instructions: | This file contains both AI-facing rules and human-only reference sections. Human-only sections are enclosed in `` / @@ -81,4 +81,4 @@ reviews: 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). \ No newline at end of file + reference section, note this as a suggestion (not a required fix). diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 03596738..b8d481d7 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -54,6 +54,7 @@ tl;dr: * Auto-generated headers: `wled00/html_*.h` and `wled00/js_*.h` — **never edit or commit**. * ArduinoJSON + AsyncJSON: `wled00/src/dependencies/json` (included via `wled.h`). CI/CD: `.github/workflows/`. * Usermods: `usermods/` (`.h` files, included via `usermods_list.cpp`). +* Contributor docs: `docs/` (coding guidelines, design docs). Main development trunk: `mdev` branch. Make PRs against this branch. @@ -77,6 +78,7 @@ tools/ # Build tools (Node.js), partition files, and generi tools/cdata.js # Web UI → header build script tools/cdata-test.js # Test suite package.json # Node.js scripts and release ID +docs/ # Contributor docs: coding guidelines and design documentation .github/workflows/ # CI/CD pipelines ``` @@ -95,7 +97,7 @@ package.json # Node.js scripts and release ID - **C++ formatting available**: `clang-format` is installed but not in CI - No automated linting is configured — match existing code style in files you edit. -See `cpp.instructions.md`, `esp-idf.instructions.md` and `web.instructions.md` for language-specific conventions, and `cicd.instructions.md` for GitHub Actions workflows. +See `docs/cpp.instructions.md`, `docs/esp-idf.instructions.md` and `docs/web.instructions.md` for language-specific conventions, and `docs/cicd.instructions.md` for GitHub Actions workflows. ### Attribution for AI-generated code Using AI-generated code can hide the source of the inspiration / knowledge / sources it used. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20743d7e..1cb790bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,9 +76,9 @@ When in doubt, it is easiest to replicate the code style you find in the files y Our review bot (coderabbit) has learned lots of detailed guides and hints - it will suggest them automatically when you submit a PR for review. If you are curious, these are the detailed guides: -* [C++ Coding](https://github.com/MoonModules/WLED-MM/blob/mdev/.github/cpp.instructions.md) -* [WebUi: HTML, JS, CSS](https://github.com/MoonModules/WLED-MM/blob/mdev/.github/web.instructions.md) -* [Using ESP-IDF directly](https://github.com/MoonModules/WLED-MM/blob/mdev/.github/esp-idf.instructions.md) +* [C++ Coding](https://github.com/MoonModules/WLED-MM/blob/mdev/docs/cpp.instructions.md) +* [WebUi: HTML, JS, CSS](https://github.com/MoonModules/WLED-MM/blob/mdev/docs/web.instructions.md) +* [Using ESP-IDF directly](https://github.com/MoonModules/WLED-MM/blob/mdev/docs/esp-idf.instructions.md) Below are the main rules used the WLED-MM repository. diff --git a/.github/cicd.instructions.md b/docs/cicd.instructions.md similarity index 100% rename from .github/cicd.instructions.md rename to docs/cicd.instructions.md diff --git a/.github/cpp.instructions.md b/docs/cpp.instructions.md similarity index 100% rename from .github/cpp.instructions.md rename to docs/cpp.instructions.md diff --git a/.github/esp-idf.instructions.md b/docs/esp-idf.instructions.md similarity index 100% rename from .github/esp-idf.instructions.md rename to docs/esp-idf.instructions.md diff --git a/.github/web.instructions.md b/docs/web.instructions.md similarity index 100% rename from .github/web.instructions.md rename to docs/web.instructions.md