From cf34f3047c85f154d67dab823b7d2ae0235202c8 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Sat, 1 Nov 2025 15:39:55 +0900 Subject: [PATCH] CONTRIBUTING.rst: Require adding braces for single statements The coding style for Linux kernel requires no braces for a single statements. However, the preference of this project is having braces even if the statement is single. --- CONTRIBUTING.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 4148640624a2e5..3c990d339ec601 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -46,6 +46,13 @@ Coding Guidelines information, please read here: https://github.com/torvalds/linux/blob/master/Documentation/process/coding-style.rst + - Exception: Always use braces for all control statements even for a single + statement. For example:: + + if (!success) { + return; + } + - Avoid trailing spaces. To view trailing spaces before making a commit, use "git diff" on your changes. If colors are enabled for git in the command prompt, it will show you any whitespace issues