From a64bd33973770f249e66060cbd4c0ea16ccfa8e3 Mon Sep 17 00:00:00 2001 From: Quinn Date: Tue, 12 Aug 2025 12:38:34 +0200 Subject: [PATCH] rewrite the style guide --- docs/dev/styleref.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/dev/styleref.md b/docs/dev/styleref.md index 17dbe78..b248574 100644 --- a/docs/dev/styleref.md +++ b/docs/dev/styleref.md @@ -24,9 +24,10 @@ Within [intdef.h](/src/util/intdef.h) there live definitions for static-width in ### style guide - Code must be written correctly, read [Correct C](./correct-c.md) if more information is required. -- K&R style braces/[indentation](https://en.wikipedia.org/wiki/Indentation_style) -- typedefs are discouraged -- snake_case is used for all user-defined symbols. Macros are often all-uppercase, same goes for enums and other types of compile-time constants. -- tabs are used for indentation, spaces are used for alignment. -- British spelling is (generally) preferred, but not enforced. -- commits should attempt to convey clearly what is being changed, for the sanity of the maintainer(s). +- `snake_casing` is used, with no [Hungarian notation](https://en.m.wikipedia.org/wiki/Hungarian_notation). (macros are all-uppercase, with a few exceptions) +- [K&R style braces/indentation](https://en.wikipedia.org/wiki/Indentation_style) should be used. +- For indentation tabs are used, and are assumed to be 8 spaces wide. For alignment spaces should be used. +- A space should precede a pointer `*` should be with the name, rather than the type. For `const` clarity, and chains such as: `u8 *a, *b, *c;` +- Generally speaking, British spelling is preferred. Define potential macros for, or when using alternate dialects. +- Grammar should be correct. (`don't` or `do not`, not `dont`) +- Commits should attempt to convey clearly what is being changed, for the sanity of the maintainer(s).