@@ -203,19 +203,6 @@ template <> struct
MappingTraits {
}
};
-template <> struct ScalarEnumerationTraits
{
gedare wrote:
I went back to doing this in the way that will fail quietly for `libFormat`,
but works for backward compatibility for `clang-format`.
@@ -203,19 +203,6 @@ template <> struct
MappingTraits {
}
};
-template <> struct ScalarEnumerationTraits
{
gedare wrote:
> I'd stick to the `bool` for the public API, and keep the `enum` only in the
> private part, i.e. `format.cpp` and parse the `enum`
@@ -203,19 +203,6 @@ template <> struct
MappingTraits {
}
};
-template <> struct ScalarEnumerationTraits
{
gedare wrote:
Could we make `libFormat` users break somewhere else using something like
`assert(Style.AlignAfterOpenBracket != FormatStyle::AlwaysB
@@ -203,19 +203,6 @@ template <> struct
MappingTraits {
}
};
-template <> struct ScalarEnumerationTraits
{
gedare wrote:
I tried it out anyway, the way I could see how to do it so that `libFormat`
breaks but `clang-format` does not. I don't really like
@@ -203,19 +203,6 @@ template <> struct
MappingTraits {
}
};
-template <> struct ScalarEnumerationTraits
{
gedare wrote:
I understand. The only way I see to make this work out is to add two new
members of `BracketAlignmentStyle` (e.g., `BAS_AlwaysBreakDe
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
@@ -76,26 +127,16 @@ struct FormatStyle {
/// argument2);
/// \endcode
BAS_DontAlign,
-/// Always break after an open bracket, if the parameters don't fit
-/// on a single line, e.g.:
-/// \code
-/// someLongFunction(
-/// argument1
@@ -76,26 +127,16 @@ struct FormatStyle {
/// argument2);
/// \endcode
BAS_DontAlign,
-/// Always break after an open bracket, if the parameters don't fit
-/// on a single line, e.g.:
-/// \code
-/// someLongFunction(
-/// argument1
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
@@ -6207,24 +6207,36 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
(Right.isBlockIndentedInitRBrace(Style)));
}
- // We only break before r_paren if we're in a block indented context.
+ // We can break before r_paren
@@ -9728,6 +9737,335 @@ TEST_F(FormatTest, ParenthesesAndOperandAlignment) {
Style);
}
+TEST_F(FormatTest, AlignAndBreakControlStatements) {
+ FormatStyle Style = getLLVMStyle();
+
+ Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
+ Style.BreakAfter
@@ -76,26 +127,16 @@ struct FormatStyle {
/// argument2);
/// \endcode
BAS_DontAlign,
-/// Always break after an open bracket, if the parameters don't fit
-/// on a single line, e.g.:
-/// \code
-/// someLongFunction(
-/// argument1
@@ -358,10 +358,13 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
// Allow breaking before the right parens with block indentation if there was
// a break after the left parens, which is tracked by
BreakBeforeClosingParen.
- if (Style.AlignAfterOpenBra
@@ -6207,24 +6207,36 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
(Right.isBlockIndentedInitRBrace(Style)));
}
- // We only break before r_paren if we're in a block indented context.
+ // We can break before r_paren
gedare wrote:
I don't know why the docs aren't building.
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 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 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 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
gedare wrote:
In light of #144560 I have separated out the handling of the Braced List
initializers in a similar way. Although this does not fix the bug, it might
provide a workaround by being able to turn off the "block indent" behavior of
the braced list initializers separately from function
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/154978
Add AlignBracketsTest.cpp to collect tests from FormatTest.cpp related to
alignment and breaking after open brackets.
>From 1516dfc7abb9fa2bbcf2431573daea08e78bd41d Mon Sep 17 00:00:00 2001
From: Gedare Bloom
D
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
@@ -9694,6 +9694,304 @@ TEST_F(FormatTest, ParenthesesAndOperandAlignment) {
Style);
}
+TEST_F(FormatTest, AlignAfterConditionalStatements) {
gedare wrote:
I will relocate this test after
https://github.com/llvm/llvm-project/pull/154978 is mer
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/108332
>From 34c27d6148111d0dfac4ab1c71cc34adf1c0299b 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
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/139750
>From 95627497cf8b5626afe7c17011eb8242a4414203 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 13 May 2025 08:42:41 -0600
Subject: [PATCH 1/5] [clang-format] Add IndentPPDirectives Leave option
Allow an o
gedare wrote:
ping @owenca
https://github.com/llvm/llvm-project/pull/139750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
gedare wrote:
> Should `Leave` apply to the hash only or also to the name after the hash?
Because there is an `AfterHash` option, we should preserve all the whitespace
around the hash when using `Leave`.
https://github.com/llvm/llvm-project/pull/139750
_
@@ -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/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
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/139750
>From 5974807cae2cf08b26cadb2fce3bd0236519f3c0 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 13 May 2025 08:42:41 -0600
Subject: [PATCH 1/5] [clang-format] Add IndentPPDirectives Leave option
Allow an o
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/139750
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-se
gedare wrote:
This change can help support some of the goals stated in #35368 but doesn't
exactly capture the intent of that Issue, which adds a requirement to make the
PP indent level also advance the indent level. I am not currently interested in
that particular feature.
https://github.com/
https://github.com/gedare edited
https://github.com/llvm/llvm-project/pull/139750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare edited
https://github.com/llvm/llvm-project/pull/139750
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/139750
Allow an option to leave preprocessor directive indenting as-is. This
simplifies handling mixed styles of CPP directive indentation.
Fixes #38511
Rate limit · GitHub
bod
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/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
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
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
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
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
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
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
gedare wrote:
Review comments addressed. Nice splitting of the test case.
https://github.com/llvm/llvm-project/pull/112482
___
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/112482
>From 8282f754ae40b64a88e2d22a6cb21e7028da8371 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/7] [clang-format] add BinPackLongBracedList style option
The use
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/112482
>From 8282f754ae40b64a88e2d22a6cb21e7028da8371 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/6] [clang-format] add BinPackLongBracedList style option
The use
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/112482
>From 8282f754ae40b64a88e2d22a6cb21e7028da8371 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/4] [clang-format] add BinPackLongBracedList style option
The use
gedare wrote:
> What about changing it to an option (e.g. `BinPackBracedListThreshold`) with
> a default value of about 20? If the number of elements in the list is more
> than the threshold, they will be bin packed even if `BinPackArguments` is set
> to false.
That was my original approach,
@@ -9608,6 +9608,10 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"\"a aaa a aaa a\"\n"
");",
Style);
+ verifyFormat("aaa(\n"
+ "&b
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/124998
>From 69658e8c2beb787b90ea29765bf428892d4e5ec4 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Wed, 29 Jan 2025 14:53:10 -0700
Subject: [PATCH 1/3] [clang-format] Fix mismatched break in BlockIndent
Near the C
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/124998
>From 69658e8c2beb787b90ea29765bf428892d4e5ec4 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Wed, 29 Jan 2025 14:53:10 -0700
Subject: [PATCH 1/2] [clang-format] Fix mismatched break in BlockIndent
Near the C
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/112482
>From a01d46f6dfe7f383557b7e98df01b73a4f238cdf Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/5] [clang-format] add BinPackLongBracedLists style option
The us
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
@@ -11220,6 +11220,333 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateCloser) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
+ // Begin with tests covering the case where there is no constr
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
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/112482
>From a01d46f6dfe7f383557b7e98df01b73a4f238cdf Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/3] [clang-format] add BinPackLongBracedLists style option
The us
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/124998
Near the ColumnLimit a break could be inserted before a right parens with
BlockIndent without a break after the matching left parens. Avoid these hanging
right parens by disallowing breaks before right parens un
https://github.com/gedare closed
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
gedare wrote:
The improved fix is in https://github.com/llvm/llvm-project/pull/124891.
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
gedare wrote:
I'll rebase on the other PR after it merges.
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare reopened
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare closed
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
gedare wrote:
See https://github.com/llvm/llvm-project/pull/124891.
https://github.com/llvm/llvm-project/pull/124634
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/gedare approved this pull request.
https://github.com/llvm/llvm-project/pull/124891
___
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/124634
>From 5292f110ce4c7f5b060165e3c3f817b6716c2c1e Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Mon, 27 Jan 2025 14:49:54 -0700
Subject: [PATCH 1/2] [clang-format] Fix annotating attrs in class/struct
An attrib
@@ -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
gedare wrote:
> I'd add an annotating test. (And drop the formatting test.)
Yes, that's a good idea, I've done it. I started with the formatting test, but
it is unnecessary (although a good, complicated bit of formatting) since the
bug was in the annotation.
https://github.com/llvm/llvm-proje
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
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/124634
An attribute in a class/struct declaration confuses the parser to treat the
identifier following the attribute as a function or variable name.
Fixes #124574
>From db6e09dca9d39b1c21543a069e7a1d1bf3997c0c Mon Se
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/118409
>From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Mon, 2 Dec 2024 15:16:39 -0700
Subject: [PATCH 1/7] [clang-format] Add PenaltyBreakBeforeMemberAccess
Add a config
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/118409
>From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Mon, 2 Dec 2024 15:16:39 -0700
Subject: [PATCH 1/6] [clang-format] Add PenaltyBreakBeforeMemberAccess
Add a config
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
gedare wrote:
@owenca if you could take another look at this PR I'd appreciate it.
https://github.com/llvm/llvm-project/pull/112482
___
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/112482
>From eb789f3dd6aab070865fc92270aa20f872f30dab Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 15 Oct 2024 23:55:49 -0600
Subject: [PATCH 1/3] [clang-format] add BinPackLongBracedLists style option
The us
@@ -4316,7 +4316,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine
&Line,
// aaa
// .a.();
return !Right.NextOperator || !Right.NextOperator->Previous->closesScope()
- ? 150
+ ? Style.Pena
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) {
Style);
}
+TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) {
+ FormatStyle Style = getLLVMStyle();
+ Style.ColumnLimit = 8;
+ Style.PenaltyExcessCharacter = 15;
+ verifyFormat("
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/118409
>From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Mon, 2 Dec 2024 15:16:39 -0700
Subject: [PATCH 1/5] [clang-format] Add PenaltyBreakBeforeMemberAccess
Add a config
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/118409
>From 86bc2d2fe03d84879870eec1a8c10912076686c2 Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Mon, 2 Dec 2024 15:16:39 -0700
Subject: [PATCH 1/4] [clang-format] Add PenaltyBreakBeforeMemberAccess
Add a config
@@ -4316,7 +4316,7 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine
&Line,
// aaa
// .a.();
return !Right.NextOperator || !Right.NextOperator->Previous->closesScope()
- ? 150
+ ? Style.Pena
@@ -22365,6 +22365,19 @@ TEST_F(FormatTest, BreakPenaltyAfterForLoopLParen) {
Style);
}
+TEST_F(FormatTest, BreakPenaltyBeforeMemberAccess) {
gedare wrote:
I'm confused by the sorting request. I put it where it is lexicographically
sorted.
ht
gedare wrote:
> Please rebase and run `ninja clang-format-style`.
Done.
https://github.com/llvm/llvm-project/pull/118409
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
1 - 100 of 243 matches
Mail list logo