docs: add coding and shell conventions to AGENTS.md
- Add include ordering rules: C++ std, C std, OS-specific, third-party, local headers (separated by blank lines) - Clarify <> for system headers, "" for third-party deps - Remove .exe from run command - Mark shell code blocks as sh (POSIX compliant) - Add shell script conventions section
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
|
||||
### Commands
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cmake -S . -B build -GNinja
|
||||
ninja -C build
|
||||
./build/cuber.exe
|
||||
./build/cuber
|
||||
```
|
||||
|
||||
### Dependencies
|
||||
@@ -42,6 +42,26 @@ to the custom scripts instead of system-installed packages.
|
||||
- **4-space indentation**
|
||||
- **No semicolons after closing braces** for namespaces/classes
|
||||
- `auto` for obvious types (e.g. `auto main(...) -> int`)
|
||||
- `<>` includes only for system headers (std, OS, etc.)
|
||||
- `""` includes for third-party dependencies (e.g. `fmt`, `nlohmann/json`)
|
||||
- Include order:
|
||||
1. C++ standard library headers (`<chrono>`, `<vector>`, etc.)
|
||||
2. *(blank line)*
|
||||
3. C standard library headers (`<stdlib.h>`, `<string.h>`, etc.)
|
||||
4. *(blank line)*
|
||||
5. OS-specific headers (Windows API, POSIX, etc.)
|
||||
6. *(blank line)*
|
||||
7. Third-party dependencies (`"fmt/core.h"`, etc.)
|
||||
8. *(blank line)*
|
||||
9. Local/project headers
|
||||
|
||||
## Shell Scripts
|
||||
|
||||
- Always use `#!/bin/sh` shebang for shell scripts
|
||||
- Scripts must be POSIX compliant (no bashisms)
|
||||
- When providing commands to users:
|
||||
- Windows/PowerShell: use `` ` `` for line continuation
|
||||
- Unix/Linux/macOS: use `\` for line continuation
|
||||
|
||||
## Source Layout
|
||||
|
||||
|
||||
Reference in New Issue
Block a user