[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-06-10 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via 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 01/11] Format: add AlignAfterControlStatement Introduce new style

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-22 Thread via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-21 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-21 Thread Gedare Bloom via cfe-commits
@@ -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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-21 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-21 Thread Gedare Bloom via 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/6] Format: add AlignAfterControlStatement Introduce new style op

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-12 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
@@ -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 { +

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-05-01 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Gedare Bloom via cfe-commits
@@ -5283,6 +5299,7 @@ struct FormatStyle { bool operator==(const FormatStyle &R) const { return AccessModifierOffset == R.AccessModifierOffset && AlignAfterOpenBracket == R.AlignAfterOpenBracket && + AlignAfterControlStatement == R.AlignAfterControlSt

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Björn Schäpers via cfe-commits
@@ -5283,6 +5299,7 @@ struct FormatStyle { bool operator==(const FormatStyle &R) const { return AccessModifierOffset == R.AccessModifierOffset && AlignAfterOpenBracket == R.AlignAfterOpenBracket && + AlignAfterControlStatement == R.AlignAfterControlSt

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-30 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-04-29 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-02-19 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-02-19 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-02-15 Thread Owen Pan via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-02-11 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-02-09 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Gedare Bloom via 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/7] Format: add AlignAfterOpenBracketOptions Introduce new option

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Björn Schäpers via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-29 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; gedar

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via 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/4] Format: add AlignAfterOpenBracketOptions Introduce new option

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-28 Thread Gedare Bloom via 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/3] Format: add AlignAfterOpenBracketOptions Introduce new option

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2025-01-27 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-21 Thread Björn Schäpers via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; Hazar

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-14 Thread Gedare Bloom via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; gedar

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-14 Thread Gedare Bloom via cfe-commits
@@ -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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-14 Thread Gedare Bloom via cfe-commits
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: *

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-13 Thread Björn Schäpers via cfe-commits
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { FormatStyle LLVMStyle; LLVMStyle.AccessModifierOffset = -2; LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align; + LLVMStyle.AlignAfterOpenBracketBreak = {}; Hazar

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-02 Thread Gedare Bloom via cfe-commits
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/

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-12-02 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-10-17 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-10-17 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-10-15 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-09-23 Thread Gedare Bloom via 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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-09-23 Thread Gedare Bloom via cfe-commits
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

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-09-11 Thread via cfe-commits
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)

[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

2024-09-11 Thread Gedare Bloom via cfe-commits
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