[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250210-clang-format-fixes-v2-1-37894413bbee@collabora.com>
Date: Thu, 10 Apr 2025 22:58:53 +0200
From: Michael Riesch via B4 Relay <devnull+michael.riesch.collabora.com@...nel.org>
To: Miguel Ojeda <ojeda@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Nick Desaulniers <nick.desaulniers+lkml@...il.com>
Cc: Collabora Kernel Team <kernel@...labora.com>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
Michael Riesch <michael.riesch@...fvision.net>,
Michael Riesch <michael.riesch@...labora.com>
Subject: [PATCH v2 1/2] clang-format: do not allow short enums on a single
line
From: Michael Riesch <michael.riesch@...fvision.net>
clang-format 11 introduced the option "AllowShortEnumsOnASingleLine".
Set it to "false" in order to avoid short enums of the form:
enum my_short_num { green, red };
With the option set to "false", they will be converted to
enum my_short_num {
green,
red
};
which is consistent with the definition of enums with more items.
Signed-off-by: Michael Riesch <michael.riesch@...fvision.net>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
Signed-off-by: Michael Riesch <michael.riesch@...labora.com>
---
.clang-format | 1 +
1 file changed, 1 insertion(+)
diff --git a/.clang-format b/.clang-format
index fe1aa1a30d40..8040b516185b 100644
--- a/.clang-format
+++ b/.clang-format
@@ -19,6 +19,7 @@ AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
--
2.39.5
Powered by blists - more mailing lists