Update AGENTS.md

This commit is contained in:
Abdelrahman Said
2026-06-27 02:56:28 +01:00
parent d03a661a44
commit 7b69940028
+22
View File
@@ -29,6 +29,28 @@ All code follows the patterns established in `src/wapp/`. The project prefix is
| File-scope globals | `_` + camelCase | `_default_allocator` |
| File-scope constants | SCREAMING_SNAKE | `MAX_NODE_NAME` |
### Formatting
- **Indentation**: tabs (no spaces). Tab width is a viewer preference.
- **Braces**: always required after `if`, `else`, `for`, `while`, `do` — even
when the body is a single statement. This avoids ambiguity and makes diffs
cleaner.
```c
// correct
if (condition) {
do_thing();
}
for (int i = 0; i < n; i++) {
process(i);
}
// wrong — no braces, spaces instead of tabs
if (condition)
do_thing();
```
### Storage qualifiers
Use the `wp_extern` / `wp_intern` / `wp_persist` aliases from wapp: