gedare wrote:
Ping.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3373,6 +3409,51 @@ the configuration (without a prefix: ``Auto``).
+.. _BreakBeforeCloseBracketIf:
+
+**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 21`
:ref:`¶ `
+ Force break before the right parenthesis of an if control statement
+ when the
@@ -3373,6 +3409,51 @@ the configuration (without a prefix: ``Auto``).
+.. _BreakBeforeCloseBracketIf:
+
+**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 21`
:ref:`¶ `
+ Force break before the right parenthesis of an if control statement
+ when the
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 5972376f719665225b04bf121cda6c769e3392d9 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 01/11] Format: add AlignAfterControlStatement
Introduce new style
@@ -3373,6 +3409,51 @@ the configuration (without a prefix: ``Auto``).
+.. _BreakBeforeCloseBracketIf:
+
+**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 21`
:ref:`¶ `
+ Force break before the right parenthesis of an if control statement
+ when the
https://github.com/gedare edited
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 5972376f719665225b04bf121cda6c769e3392d9 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/9] Format: add AlignAfterControlStatement
Introduce new style op
https://github.com/mydeveloperday commented:
your BreakBeforeCloseBracket true case seem to imply
BreakAfterOpenBracket is that what you expect?
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.ll
@@ -3373,6 +3409,51 @@ the configuration (without a prefix: ``Auto``).
+.. _BreakBeforeCloseBracketIf:
+
+**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 21`
:ref:`¶ `
+ Force break before the right parenthesis of an if control statement
+ when the
@@ -3373,6 +3409,51 @@ the configuration (without a prefix: ``Auto``).
+.. _BreakBeforeCloseBracketIf:
+
+**BreakBeforeCloseBracketIf** (``Boolean``) :versionbadge:`clang-format 21`
:ref:`¶ `
+ Force break before the right parenthesis of an if control statement
+ when the
https://github.com/mydeveloperday edited
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 5972376f719665225b04bf121cda6c769e3392d9 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/8] Format: add AlignAfterControlStatement
Introduce new style op
@@ -9694,6 +9694,304 @@ TEST_F(FormatTest, ParenthesesAndOperandAlignment) {
Style);
}
+TEST_F(FormatTest, AlignAfterConditionalStatements) {
gedare wrote:
Yes, it might be a good idea to consolidate all of the alignment tests in a new
file. I
gedare wrote:
Take 3. This is now a simpler solution that separates rules for breaking within
`if`, loop, and `switch` control statements. These explicit style options
override the `AlwaysBreak` and `BlockIndent` options, which should be now only
effective for function-like parentheses and bra
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 5972376f719665225b04bf121cda6c769e3392d9 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/6] Format: add AlignAfterControlStatement
Introduce new style op
gedare wrote:
> > > I prefer that we limit this to breaking after the left parenthesis of a
> > > control statement, with true/false or Always, Never, Multiline,
> > > BlockIndent, etc.
> >
> >
> > if I understand you correctly, you would like a new style option added for
> > setting break
gedare wrote:
> Why would `AlignAfterControlStatement` have anything to do with
> `AlignAfterOpenBracket`, which is for arguments of function/macro calls?
>
Unfortunately, `AlignAfterOpenBracket` is not just for arguments of
function/macro calls. It affects parentheses of control statements a
https://github.com/owenca commented:
You need to run `ninja clang-format-style` to update the documentation.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman
owenca wrote:
> > > > I prefer that we limit this to breaking after the left parenthesis of a
> > > > control statement, with true/false or Always, Never, Multiline,
> > > > BlockIndent, etc.
> > >
> > >
> > > if I understand you correctly, you would like a new style option added
> > > for s
@@ -9694,6 +9694,304 @@ TEST_F(FormatTest, ParenthesesAndOperandAlignment) {
Style);
}
+TEST_F(FormatTest, AlignAfterConditionalStatements) {
owenca wrote:
```suggestion
TEST_F(FormatTest, AlignAfterControlStatements) {
```
Can you move this to
@@ -62,6 +62,22 @@ struct FormatStyle {
/// \version 3.3
int AccessModifierOffset;
+ /// Different styles for breaking the parenthesis after a control statement
+ /// (``if/switch/while/for ...``).
+ /// \version 21
+ enum BreakAfterControlStatementStyle : int8_t {
+
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From b2cbc7730aca7c75679c070292cfd07cf55854af Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterControlStatement
Introduce new style op
owenca wrote:
> When I updated, my build target for `FormatTests` stopped working.
>
> ```
> ninja -C build clang-format FormatTests
> ninja: Entering directory `build'
> ninja: error: unknown target 'FormatTests'
> ```
>
> I'm trying to figure out what changed or how to modify my workflow. I t
gedare wrote:
When I updated, my build target for `FormatTests` stopped working.
```
ninja -C build clang-format FormatTests
ninja: Entering directory `build'
ninja: error: unknown target 'FormatTests'
```
I'm trying to figure out what changed or how to modify my workflow. I think I
ran this PR
@@ -5283,6 +5299,7 @@ struct FormatStyle {
bool operator==(const FormatStyle &R) const {
return AccessModifierOffset == R.AccessModifierOffset &&
AlignAfterOpenBracket == R.AlignAfterOpenBracket &&
+ AlignAfterControlStatement == R.AlignAfterControlSt
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 8846ff045f969b258554c3cfb72161e9f61dda19 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/3] Format: add AlignAfterControlStatement
Introduce new style op
@@ -5283,6 +5299,7 @@ struct FormatStyle {
bool operator==(const FormatStyle &R) const {
return AccessModifierOffset == R.AccessModifierOffset &&
AlignAfterOpenBracket == R.AlignAfterOpenBracket &&
+ AlignAfterControlStatement == R.AlignAfterControlSt
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 8846ff045f969b258554c3cfb72161e9f61dda19 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterControlStatement
Introduce new style op
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h --
clang/include/clang/Format/Format.h clang/lib/Forma
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 64000ad7d2310ac916b37ed808997bfcb6b9f324 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/4] Format: add AlignAfterControlStatement
Introduce new style op
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp --
clang/include/clang/Format/Format.h clang/lib/Forma
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 64000ad7d2310ac916b37ed808997bfcb6b9f324 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/3] Format: add AlignAfterControlStatement
Introduce new style op
gedare wrote:
> > > I prefer that we limit this to breaking after the left parenthesis of a
> > > control statement, with true/false or Always, Never, Multiline,
> > > BlockIndent, etc.
> >
> >
> > if I understand you correctly, you would like a new style option added for
> > setting break
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 64000ad7d2310ac916b37ed808997bfcb6b9f324 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterControlStatement
Introduce new style op
owenca wrote:
> > I prefer that we limit this to breaking after the left parenthesis of a
> > control statement, with true/false or Always, Never, Multiline,
> > BlockIndent, etc.
>
> if I understand you correctly, you would like a new style option added for
> setting break option for all con
gedare wrote:
> I prefer that we limit this to breaking after the left parenthesis of a
> control statement, with true/false or Always, Never, Multiline, BlockIndent,
> etc.
if I understand you correctly, you would like a new style option added for
setting break option for all control stateme
owenca wrote:
I prefer that we limit this to breaking after the left parenthesis of a control
statement, with true/false or Always, Never, Multiline, BlockIndent, etc.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-c
HazardyKnusperkeks wrote:
Was there a change which I should look at again? I find the GitHub UI for
reviews terrible. If it was just a rebase my vote stands.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lis
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 5cec30f5d93a22f10a985cb3e4418e7d29d31a00 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/7] Format: add AlignAfterOpenBracketOptions
Introduce new option
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 8ca6e30c6fbe1e51b711c5c15cdeb6517097f3e8 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/7] Format: add AlignAfterOpenBracketOptions
Introduce new option
gedare wrote:
Rebased to `main` for `21.0.0git`
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 8ca6e30c6fbe1e51b711c5c15cdeb6517097f3e8 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/5] Format: add AlignAfterOpenBracketOptions
Introduce new option
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
https://github.com/gedare deleted
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From c7b34d10bb8f937f9a11778c327f82cee8e60fe5 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/5] Format: add AlignAfterOpenBracketOptions
Introduce new option
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
gedar
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From c7b34d10bb8f937f9a11778c327f82cee8e60fe5 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/4] Format: add AlignAfterOpenBracketOptions
Introduce new option
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From c7b34d10bb8f937f9a11778c327f82cee8e60fe5 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/3] Format: add AlignAfterOpenBracketOptions
Introduce new option
gedare wrote:
There's a problem between this implementation and the fix in #119989 that I
need to figure out.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
Hazar
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
gedar
@@ -811,10 +816,11 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
if (!Tok.Previous)
return true;
if (Tok.Previous->isIf())
- return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak;
-return !Tok.Previous->i
gedare wrote:
> I don't think this is the way to go, or at least not with this name.
>
> How about going the `Custom` way?
Adding a `Custom` option to `AlignAfterOpenBracket` is an interesting proposal.
There have been some ideas floated in other Issues and PRs related to this, for
example:
*
@@ -811,10 +816,11 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
if (!Tok.Previous)
return true;
if (Tok.Previous->isIf())
- return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak;
-return !Tok.Previous->i
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
I don't think this is the way to go, or at least not with this name.
How about going the `Custom` way?
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llv
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
Hazar
gedare wrote:
Rebased to main. This PR addresses several long-standing issues. It would be
great to get a review.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 70e0cbd5c648a532952ddb00a719b03a8f31160e Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterOpenBracketOptions
Introduce new option
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From f21e1c62aa64ce497d5d4b500f412752eae9ceb0 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterOpenBracketOptions
Introduce new option
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From d4ea6c119580f4e153a0844f0e29cb393c340279 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterOpenBracketOptions
Introduce new option
gedare wrote:
ping
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
gedare wrote:
Rebased to main to pick up recent regression fixes BlockIndent/AlwaysBreak.
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From d099408d791fef55b3064f6597bdd2fb0b4537da Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Thu, 20 Jun 2024 17:35:39 -0600
Subject: [PATCH 1/2] Format: add AlignAfterOpenBracketOptions
Introduce new option
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Gedare Bloom (gedare)
Changes
Introduce sub-options for `AlignAfterOpenBracketBreak` to allow for control of
`AlignAfterOpenBracket` with `AlwaysBreak` and `BlockIndent` selectively for
`if` conditional statements (as currently supported)
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/108332
Introduce sub-options for `AlignAfterOpenBracketBreak` to allow for control of
`AlignAfterOpenBracket` with `AlwaysBreak` and `BlockIndent` selectively for
`if` conditional statements (as currently supported), o
72 matches
Mail list logo