You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`npm run build`|~3 s | 30 s | Web UI → `wled00/html_*.h` headers |
14
+
|`npm run build`|~3 s | 30 s | Web UI → `wled00/html_*.h``wled00/js_*.h`headers |
15
15
|`npm test`|~40 s | 2 min | Validates build system |
16
16
|`npm run dev`| continuous | — | Watch mode, auto-rebuilds on changes |
17
17
|`pio run -e <env>`| 15–20 min | 30 min | First build downloads toolchains; subsequent builds are faster |
@@ -20,16 +20,21 @@ Use these timeout values when running builds:
20
20
21
21
## Development Workflow
22
22
23
+
### Code Style Summary
24
+
-**C++** files in `wled00/` and `usermods/`: 2-space indentation (no tabs), camelCase functions/variables, PascalCase classes, UPPER_CASE macros. No C++ exceptions — use return codes and debug macros.
25
+
-**Web UI** files in `wled00/data`: indent HTML and JavaScript with tabs, CSS with tabs.
26
+
-**CI/CD workflows** in `.github/workflows`: 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. SHA pinning recommended.
27
+
23
28
### Web UI Changes
24
29
25
30
1. Edit files in `wled00/data/`
26
-
2. Run `npm run build` to regenerate `wled00/html_*.h` headers
31
+
2. Run `npm run build` to regenerate `wled00/html_*.h``wled00/js_*.h`headers
27
32
3. Test with local HTTP server (see Manual Testing below)
28
33
4. Run `npm test` to validate
29
34
30
35
### Firmware Changes
31
36
32
-
1. Edit files in `wled00/` (but **never**`html_*.h` files)
37
+
1. Edit files in `wled00/` (but **never**`html_*.h`and `js_*.h`files)
For detailed build timeouts, development workflows, troubleshooting, and validation steps, see [agent-build.instructions.md](agent-build.instructions.md).
48
49
49
50
## Repository Structure
50
51
51
52
tl;dr:
52
-
* Firmware source: `wled00/` (C++).
53
-
* Build targets: `platformio.ini`.
54
-
* Web UI source: `wled00/data/`.
55
-
* Auto-generated headers: `wled00/html_*.h` — **never edit or commit**.
docs/ # Contributor docs: coding guidelines and design documentation
82
82
.github/workflows/ # CI/CD pipelines
83
83
```
84
-
<!-- HUMAN_ONLY_END -->
85
84
85
+
<!-- HUMAN_ONLY_END -->
86
86
## General Guidelines
87
87
88
-
-**Never edit or commit**`wled00/html_*.h` — auto-generated from `wled00/data/`.
89
88
-**Repository language is English.** Suggest translations for non-English content.
90
89
-**Use VS Code with PlatformIO extension** for best development experience.
90
+
-**Never edit or commit**`wled00/html_*.h` and `wled00/js_*.h` — auto-generated from `wled00/data/`.
91
91
-**When unsure, say so.** Gather more information rather than guessing.
92
-
-**Acknowledge good patterns** when you see them. Summarize good practices as part of your review - positive feedback always helps.
92
+
-**Acknowledge good patterns** when you see them. Positive feedback always helps.
93
93
-**Provide references** when making analyses or recommendations. Base them on the correct branch or PR.
94
-
-**Look for user-visible breakingchanges and ripple effects**. Ask for confirmation that these were introduced intentionally.
94
+
-**Highlight user-visible breakingchanges and ripple effects**. Ask for confirmation that these were introduced intentionally.
95
95
-**Unused / dead code must be justified or removed**. This helps to keep the codebase clean, maintainable and readable.
96
96
-**C++ formatting available**: `clang-format` is installed but not in CI
97
-
- No automated linting is configured — match existing code style in files you edit. See `cpp.instructions.md` and `web.instructions.md` for language-specific conventions, and `cicd.instructions.md` for GitHub Actions workflows.
97
+
- No automated linting is configured — match existing code style in files you edit.
98
+
99
+
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.
100
+
101
+
### Feature Flags
102
+
-**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.
#ifdef WLED_DMX_ENABLED // wrong flag - initialization silently skipped
111
+
initDMX();
112
+
#endif
113
+
114
+
#ifdef WLED_ENABLE_DMX // correct flag - initialization performed only when the build supports DMX
115
+
initDMX();
116
+
#endif
117
+
```
118
+
<!-- HUMAN_ONLY_END -->
119
+
98
120
99
121
### Attribution for AI-generated code
100
122
Using AI-generated code can hide the source of the inspiration / knowledge / sources it used.
101
123
- Document attribution of inspiration / knowledge / sources used in the code, e.g. link to GitHub repositories or other websites describing the principles / algorithms used.
102
-
- When a larger block of code is generated by an AI tool, mark it with an `// AI: below section was generated by an AI`comment (see C++ guidelines).
124
+
- When a larger block of code is generated by an AI tool, embed it into `// AI: below section was generated by an AI`... `// AI: end` comments (see C++ guidelines).
103
125
- Every non-trivial AI-generated function should have a brief comment describing what it does. Explain parameters when their names alone are not self-explanatory.
104
-
- AI-generated code must be well documented; comment-to-code ratio > 15% is expected. Do not rephrase source code, but explain the concepts/logic behind the code.
126
+
- AI-generated code must be well documented with meaningful comments that explain intent, assumptions, and non-obvious logic. Do not rephrase source code; explain concepts and reasoning.
105
127
106
128
### Pull Request Expectations
107
129
108
130
-**No force-push on open PRs.** Once a pull request is open and being reviewed, do not force-push (`git push --force`) to the branch. Force-pushing rewrites history that reviewers may have already commented on, making it impossible to track incremental changes. Use regular commits or `git merge` to incorporate feedback; the branch will be squash-merged when it is accepted.
131
+
-**Modifications to ``platformio.ini`` MUST be approved explicitly** by a *maintainer* or *WLED organisation Member*. Modifications to the global build environment may break github action builds. Always flag them.
109
132
-**Document your changes in the PR.** Every pull request should include a clear description of *what* changed and *why*. If the change affects user-visible behavior, describe the expected impact. Link to related issues where applicable. Provide screenshots to showcase new features.
133
+
134
+
### Supporting Reviews and Discussions
135
+
-**For "is it worth doing?" debates** about proposed reliability, safety, or data-integrity mechanisms (CRC checks, backups, power-loss protection): suggest a software **FMEA** (Failure Mode and Effects Analysis).
136
+
Clarify the main feared events, enumerate failure modes, assess each mitigation's effectiveness per failure mode, note common-cause failures, and rate credibility for the typical WLED use case.
0 commit comments