Update AGENTS.md
This commit is contained in:
@@ -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 globals | `_` + camelCase | `_default_allocator` |
|
||||||
| File-scope constants | SCREAMING_SNAKE | `MAX_NODE_NAME` |
|
| 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
|
### Storage qualifiers
|
||||||
|
|
||||||
Use the `wp_extern` / `wp_intern` / `wp_persist` aliases from wapp:
|
Use the `wp_extern` / `wp_intern` / `wp_persist` aliases from wapp:
|
||||||
|
|||||||
Reference in New Issue
Block a user