This document defines the coding style for the jsec project.
- **Indentation**: 4 spaces. No tabs.
- **Braces**: K&R style (opening brace on the same line).
if (condition) { statement; } else { statement; }
- **Line Length**: Try to keep under 80 characters, but clarity is priority.
- **Variables/Functions**: `snake_case`.
- **Types**: `PascalCase` (e.g., `TLSStream`).
- **Macros**: `UPPER_CASE`.
- Use `/* */` for multi-line comments.
- Use `//` for single-line comments.
- Comments should explain why, not what.
- Do not use deprecated functions (e.g., avoid `RSA_new`, use `EVP_PKEY`).
- Check return values of all OpenSSL functions.
- Always clear the error queue or handle errors appropriately.
- **Indentation**: 2 spaces.
- **Braces/Parens**: Standard Lisp style (trailing parens on the same line).
- **Functions/Macros**: `kebab-case`.
- **Globals/Dynamics**: `*kebab-case*`.
- Public functions must have docstrings.
- Write tests for every new feature.
- Use `jsec/test/helper.janet` for common utilities.
- Ensure tests clean up resources (use `defer`).