From: Joel Rosdahl Date: Sun, 26 Apr 2020 18:59:44 +0000 (+0200) Subject: Mention the “always use curly braces” convention in CONTRIBUTING.md X-Git-Tag: v4.0~526 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d8cd44c3504e8cc51fb56500bbf8e8523a12020;p=thirdparty%2Fccache.git Mention the “always use curly braces” convention in CONTRIBUTING.md --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9748a4e7..08d5209e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,12 +58,14 @@ little by little. Source code formatting is defined by `.clang-format` in the root directory. It's based on [LLVM's code formatting -style](https://llvm.org/docs/CodingStandards.html) with some deviations. You +style](https://llvm.org/docs/CodingStandards.html) with some exceptions. You can install the [clang-format](https://clang.llvm.org/docs/ClangFormat.html) 6.0 or newer and run `make format` to fix up the source code formatting. -Regarding naming: +Please follow these conventions: +* Always use curly braces around if/for/while/do bodies, even if they only + contain one statement. * Use `UpperCamelCase` for types (e.g. classes and structs) and namespaces. * Use `UPPER_CASE` names for macros. * Use `snake_case` for other names (functions, variables, enum values, etc.).