Skip to content

Commit 94e67c4

Browse files
authored
Enhance documentation for feature flags
Moved feature flags into separate sub-section added code example
1 parent fba4c4b commit 94e67c4

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.github/copilot-instructions.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,31 @@ docs/ # Contributor docs: coding guidelines and design doc
9494
- **Provide references** when making analyses or recommendations. Base them on the correct branch or PR.
9595
- **Highlight user-visible breaking changes and ripple effects**. Ask for confirmation that these were introduced intentionally.
9696
- **Unused / dead code must be justified or removed**. This helps to keep the codebase clean, maintainable and readable.
97-
- **Verify feature-flag names.** Every `WLED_ENABLE_*` / `WLED_DISABLE_*` flag must exactly match one of the names below — misspellings are silently ignored by the preprocessor (e.g. `WLED_IR_DISABLE` instead of `WLED_DISABLE_INFRARED`), causing silent build variations. Flag unrecognised names as likely typos and suggest the correct spelling.
98-
<br>**`WLED_DISABLE_*`**: `2D`, `ADALIGHT`, `ALEXA`, `BROWNOUT_DET`, `ESPNOW`, `FILESYSTEM`, `HUESYNC`, `IMPROV_WIFISCAN`, `INFRARED`, `LOXONE`, `MQTT`, `OTA`, `PARTICLESYSTEM1D`, `PARTICLESYSTEM2D`, `PIXELFORGE`, `WEBSOCKETS`
99-
<br>**`WLED_ENABLE_*`**: `ADALIGHT`, `AOTA`, `DMX`, `DMX_INPUT`, `DMX_OUTPUT`, `FS_EDITOR`, `GIF`, `HUB75MATRIX`, `JSONLIVE`, `LOXONE`, `MQTT`, `PIXART`, `PXMAGIC`, `USERMOD_PAGE`, `WEBSOCKETS`, `WPA_ENTERPRISE`
10097
- **C++ formatting available**: `clang-format` is installed but not in CI
10198
- No automated linting is configured — match existing code style in files you edit.
10299

103100
Refer to `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.
104101

102+
### Feature Flags
103+
- **Verify feature-flag names.** Every `WLED_ENABLE_*` / `WLED_DISABLE_*` flag must exactly match one of the names below — misspellings are silently ignored by the preprocessor (e.g. `WLED_IR_DISABLE` instead of `WLED_DISABLE_INFRARED`), causing silent build variations. Flag unrecognised names as likely typos and suggest the correct spelling.
104+
105+
**`WLED_DISABLE_*`**: `2D`, `ADALIGHT`, `ALEXA`, `BROWNOUT_DET`, `ESPNOW`, `FILESYSTEM`, `HUESYNC`, `IMPROV_WIFISCAN`, `INFRARED`, `LOXONE`, `MQTT`, `OTA`, `PARTICLESYSTEM1D`, `PARTICLESYSTEM2D`, `PIXELFORGE`, `WEBSOCKETS`
106+
107+
**`WLED_ENABLE_*`**: `ADALIGHT`, `AOTA`, `DMX`, `DMX_INPUT`, `DMX_OUTPUT`, `FS_EDITOR`, `GIF`, `HUB75MATRIX`, `JSONLIVE`, `LOXONE`, `MQTT`, `PIXART`, `PXMAGIC`, `USERMOD_PAGE`, `WEBSOCKETS`, `WPA_ENTERPRISE`
108+
109+
<!-- HUMAN_ONLY_START -->
110+
```cpp
111+
#ifdef WLED_DMX_ENABLED // wrong flag - initialization silently skipped
112+
initDMX();
113+
#endif
114+
115+
#ifdef WLED_ENABLE_DMX // correct flag - initialization performed only when the build supports DMX
116+
initDMX();
117+
#endif
118+
```
119+
<!-- HUMAN_ONLY_END -->
120+
121+
105122
### Attribution for AI-generated code
106123
Using AI-generated code can hide the source of the inspiration / knowledge / sources it used.
107124
- Document attribution of inspiration / knowledge / sources used in the code, e.g. link to GitHub repositories or other websites describing the principles / algorithms used.

0 commit comments

Comments
 (0)