From 7b6994002859437481a354561cf4e3908e7707c3 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sat, 27 Jun 2026 02:56:28 +0100 Subject: [PATCH] Update AGENTS.md --- AGENTS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 37d0d0c..6272028 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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: