From: Nathan Chancellor <nathan@kernel.org>
To: Michael Riesch <michael.riesch@wolfvision.net>
Cc: Miguel Ojeda <ojeda@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH 1/2] clang-format: do not allow short enums on a single line
Date: Tue, 11 Feb 2025 13:13:19 -0500 [thread overview]
Message-ID: <20250211181319.GA2995885@ax162> (raw)
In-Reply-To: <20250210-clang-format-fixes-v1-1-9bcf43a4b4b2@wolfvision.net>
On Mon, Feb 10, 2025 at 09:21:00AM +0100, Michael Riesch wrote:
> 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@wolfvision.net>
Seems reasonable to me.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> .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.34.1
>
next prev parent reply other threads:[~2025-02-11 18:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 8:20 [PATCH 0/2] clang-format: format short enums and macro definitions correctly Michael Riesch
2025-02-10 8:21 ` [PATCH 1/2] clang-format: do not allow short enums on a single line Michael Riesch
2025-02-11 18:13 ` Nathan Chancellor [this message]
2025-02-10 8:21 ` [PATCH 2/2] clang-format: align consecutive macros Michael Riesch
2025-02-11 18:14 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250211181319.GA2995885@ax162 \
--to=nathan@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=michael.riesch@wolfvision.net \
--cc=morbo@google.com \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox