diff options
author | Konstantin Đorđević <vomindoraan@gmail.com> | 2020-04-07 06:14:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 14:14:08 +1000 |
commit | f4b67cde8ae24fdaac70071f793f5c8d0010d959 (patch) | |
tree | 0688288ed1f65602ed8508e13cf3ec89d5677453 /docs | |
parent | 0a643be39eb710649560f80c6ce0bc32576813fd (diff) | |
download | qmk_firmware-f4b67cde8ae24fdaac70071f793f5c8d0010d959.tar.gz qmk_firmware-f4b67cde8ae24fdaac70071f793f5c8d0010d959.zip |
Update C coding conventions to match .clang-format config for i… (#8717)
* Update C coding conventions to match current .clang-format config for indenting PP directives
* Make indenting guideline clearer
Diffstat (limited to 'docs')
-rw-r--r-- | docs/coding_conventions_c.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/coding_conventions_c.md b/docs/coding_conventions_c.md index 16e28b2884..f4e359611b 100644 --- a/docs/coding_conventions_c.md +++ b/docs/coding_conventions_c.md @@ -20,11 +20,11 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * We accept both forms of preprocessor if's: `#ifdef DEFINED` and `#if defined(DEFINED)` * If you are not sure which to prefer use the `#if defined(DEFINED)` form. * Do not change existing code from one style to the other, except when moving to a multiple condition `#if`. - * Do not put whitespace between `#` and `if`. - * When deciding how (or if) to indent directives keep these points in mind: - * Readability is more important than consistency. - * Follow the file's existing style. If the file is mixed follow the style that makes sense for the section you are modifying. - * When choosing to indent you can follow the indention level of the surrounding C code, or preprocessor directives can have their own indent level. Choose the style that best communicates the intent of your code. +* When deciding how (or if) to indent preprocessor directives, keep these points in mind: + * Readability is more important than consistency. + * Follow the file's existing style. If the file is mixed, follow the style that makes sense for the section you are modifying. + * When indenting, keep the hash at the start of the line and add whitespace between `#` and `if`, starting with 4 spaces after the `#`. + * You can follow the indention level of the surrounding C code, or preprocessor directives can have their own indentation levels. Choose the style that best communicates the intent of your code. Here is an example for easy reference: |