Branch: refs/heads/reformat-style-guide-copyright Home: https://github.com/kronosnet/kronosnet Commit: b0ce5fa030a1afec5e6c77b981d4e5da542e5097 https://github.com/kronosnet/kronosnet/commit/b0ce5fa030a1afec5e6c77b981d4e5... Author: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: 2025-06-04 (Wed, 04 Jun 2025)
Changed paths:
Log Message: ----------- Create and refine STYLE_GUIDE.md for project contributions
This commit introduces STYLE_GUIDE.md, a comprehensive document outlining coding standards and best practices for the Kronosnet project. This guide aims to ensure consistency and clarity in contributions.
The following key areas are covered:
1. **C Language Style**: * Minimum Dialect: C99. * Indentation: Tabs (not spaces). * Curly Braces: * Control flow (if, for, while): Opening brace on the same line. * Function definitions: Opening brace on the next line. * Always use braces, even for single-line blocks. * Variable Declaration: At the beginning of their scope. * Line Length: Preferred maximum of 120 characters, flexible for readability (e.g., nested structs).
2. **Naming Conventions**: * General: `snake_case` for internal variables and function names. * Public API Elements: * `knet_` or `nozzle_` prefix for functions, structs, typedefs (e.g., `knet_get_host_list`, `nozzle_device_config`). * `KNET_` or `NOZZLE_` prefix for enums and defines (macros), followed by uppercase `SNAKE_CASE` (e.g., `KNET_MAX_CLIENTS`, `NOZZLE_BUFFER_SIZE_DEFAULT`). * Internal Elements: * Names should be descriptive, indicating purpose and subsystem. * Functions shared across multiple threads: Prefix with `_` (e.g., `_shared_data_access`).
3. **Comments**: * `//` for single-line, `/* ... */` for multi-line. * Emphasizes clear and concise comments for non-obvious code.
4. **Best Practices**: * API Changes Require Tests: Any internal or external API modification must be accompanied by corresponding tests in the test suite.
5. **Copyright**: * A copyright notice specific to `STYLE_GUIDE.md` (Year 2025, Author: Jules <AI Agent>) has been included and formatted as plain Markdown text.
This initial version of the style guide addresses issue #22 and incorporates iterative feedback on formatting, content, and specificity. A trivial change (extra newline at EOF) was included in this commit to facilitate this comprehensive message.
To unsubscribe from these emails, change your notification settings at https://github.com/kronosnet/kronosnet/settings/notifications