-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attach-braces after enum doesn't, unless allowshortenums is true #48983
Labels
Comments
assigned to @lunasorcery |
rettichschnidi
added a commit
to husqvarnagroup/zephyr
that referenced
this issue
Jul 22, 2022
Even when BreakBeforeBraces is set to Linux, implying BraceWrapping for AfterEnum to be true, clang-format version 12 puts the opening brace of an enum declaration on a new line. [1] One possible workaround would be to change AllowShortEnumsOnASingleLine from false to true, but that would yield a different kind of unwanted formatting. clang-format version 13 and newer have this issue fixed, therefore bumping the minimal version. [1] llvm/llvm-project#48983 Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
carlescufi
pushed a commit
to zephyrproject-rtos/zephyr
that referenced
this issue
Aug 2, 2022
Even when BreakBeforeBraces is set to Linux, implying BraceWrapping for AfterEnum to be true, clang-format version 12 puts the opening brace of an enum declaration on a new line. [1] One possible workaround would be to change AllowShortEnumsOnASingleLine from false to true, but that would yield a different kind of unwanted formatting. clang-format version 13 and newer have this issue fixed, therefore bumping the minimal version. [1] llvm/llvm-project#48983 Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
coreboot-org-bot
pushed a commit
to coreboot/zephyr-cros
that referenced
this issue
Aug 4, 2022
Even when BreakBeforeBraces is set to Linux, implying BraceWrapping for AfterEnum to be true, clang-format version 12 puts the opening brace of an enum declaration on a new line. [1] One possible workaround would be to change AllowShortEnumsOnASingleLine from false to true, but that would yield a different kind of unwanted formatting. clang-format version 13 and newer have this issue fixed, therefore bumping the minimal version. [1] llvm/llvm-project#48983 (cherry picked from commit 8027072) Original-Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com> GitOrigin-RevId: 8027072 Change-Id: Iff7393129ab8c5b5cc10901dc31fb6d7e4c3a262 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/3806496 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: CopyBot Service Account <copybot.service@gmail.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
jeremybettis
pushed a commit
to jeremybettis/zephyr
that referenced
this issue
Aug 4, 2022
Even when BreakBeforeBraces is set to Linux, implying BraceWrapping for AfterEnum to be true, clang-format version 12 puts the opening brace of an enum declaration on a new line. [1] One possible workaround would be to change AllowShortEnumsOnASingleLine from false to true, but that would yield a different kind of unwanted formatting. clang-format version 13 and newer have this issue fixed, therefore bumping the minimal version. [1] llvm/llvm-project#48983 Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extended Description
Reported by Luna on Twitter; she's stymied by the registration (e.g. real-name requirements) for the bug tracker. I can reproduce the problem.
This is an issue similar to #46927 and possibly #37302; there are a couple more attach-braces issues open as well. This is the input file:
When clang-format 11 (and 12, too) is used with attached braces and AllowShortEnumsOnASingleLine, it attaches braces but enums with trailing commas are somehow not "short".
When clang-format 11 (and 12, too) is used with attached braces but short enums are not allowed on one line, it doesn't attach at all:
PS. Probably #37302 and #21200 can be closed, as they refer to ancient versions of clang-format and suitable configurations for brace-attachment and short enums (except for this bug) are available now.
The text was updated successfully, but these errors were encountered: