ameerj wrote:
Closing in favor of #121404
https://github.com/llvm/llvm-project/pull/110560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj closed
https://github.com/llvm/llvm-project/pull/110560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -164,6 +164,40 @@ TEST_F(MatchFilePathTest, Path) {
EXPECT_FALSE(match("foo\\", R"(foo*\)"));
}
+TEST_F(MatchFilePathTest, DoubleAsterisk) {
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**b**"));
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**/b/**"));
+ EXPECT_TRUE(match("a/b/c/d_e.cpp
ameerj wrote:
@HazardyKnusperkeks Can I get your eyes on this PR please?
https://github.com/llvm/llvm-project/pull/110560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ameerj wrote:
@mydeveloperday @owenca
bump for review feedback
https://github.com/llvm/llvm-project/pull/110560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -164,6 +164,40 @@ TEST_F(MatchFilePathTest, Path) {
EXPECT_FALSE(match("foo\\", R"(foo*\)"));
}
+TEST_F(MatchFilePathTest, DoubleAsterisk) {
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**b**"));
+ EXPECT_TRUE(match("a/b/c/d.cpp", "**/b/**"));
+ EXPECT_TRUE(match("a/b/c/d_e.cpp
https://github.com/ameerj created
https://github.com/llvm/llvm-project/pull/110560
Adds `**` support for `.clang-format-ignore` to support similar pattern
matching to
[.gitignore](https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitignore.html#_pattern_format)
closes #110160
>From b
ameerj wrote:
Thanks for the review feedback @owenca @HazardyKnusperkeks
Please merge this PR for me if you feel it is ready as I don't have merge
permissions
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lis
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/19] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
ameerj wrote:
@owenca Can you review once more please?
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/18] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
ameerj wrote:
> Failed Tests (1):
Fixed in the latest commit
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/17] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
ameerj wrote:
> I'm not finding the true/false every clear, can we use an enum?
Reworked this to now be an enum. Please let me know if the intent is more clear
now or if anything needs further clarification.
https://github.com/llvm/llvm-project/pull/95013
__
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/16] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
ameerj wrote:
> It seems
> [AlignOperands](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignoperands)
> is supposed to do what this new option would, so maybe we should fix/extend
> `AlignOperands` instead?
This new setting is only responsible for breaking long expressions, not
ameerj wrote:
> The logical && and bitwise | operations are not broken up into one per line,
> and the column limit is exceeded.
@owenca this should be fixed in the latest commit
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/15] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
@@ -27628,6 +27628,119 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && condi
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/14] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Current starts a new operand in a binary operation.
ameerj wrote:
The wordin
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/11] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
ameerj wrote:
Thanks for the review and approval @HazardyKnusperkeks !
I don't have write permissions to the repo so please merge this for me when you
have a moment.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-com
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/10] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 01/10] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 1/9] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format.h
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 1/8] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format.h
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 1/7] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format.h
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/95013
>From a50f3d4395efd09eea8ba2e750bb785857f9a550 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Mon, 10 Jun 2024 12:09:40 -0400
Subject: [PATCH 1/6] Add BinPackBinaryOperations
---
clang/include/clang/Format/Format.h
@@ -1203,6 +1214,10 @@ unsigned
ContinuationIndenter::addTokenOnNewLine(LineState &State,
}
}
+ if (!Style.BinPackBinaryOperations && Previous.is(TT_BinaryOperator) &&
+ (Previous.getPrecedence() > prec::Conditional)) {
+CurrentState.BreakBeforeParameter = tru
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
https://github.com/ameerj created
https://github.com/llvm/llvm-project/pull/95013
By default, clang-format packs binary operations, but it may be desirable to
have compound operations be on individual lines instead of being packed.
This PR adds the option `BinPackBinaryOperations`, which mimic
ameerj wrote:
@HazardyKnusperkeks Thanks for the review!
I don't have repo permissions so I can't run all CI workflows or merge the PR.
https://github.com/llvm/llvm-project/pull/84988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/84988
>From 0d0868ddffe1b0668a57c10cc89614ab7c840634 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Sat, 16 Mar 2024 17:03:47 -0400
Subject: [PATCH 1/3] [clang-format] Add BreakFunctionDefinitionParameters
option
---
cl
@@ -5317,6 +5318,12 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
&Line,
if (Right.NewlinesBefore > 1 && Style.MaxEmptyLinesToKeep > 0)
return true;
+ if (Style.BreakFunctionDefinitionParameters && Line.MightBeFunctionDecl &&
ameerj wrote
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/84988
>From 0d0868ddffe1b0668a57c10cc89614ab7c840634 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Sat, 16 Mar 2024 17:03:47 -0400
Subject: [PATCH 1/2] [clang-format] Add BreakFunctionDefinitionParameters
option
---
cl
ameerj wrote:
@HazardyKnusperkeks @owenca I'd like to request a review please
https://github.com/llvm/llvm-project/pull/84988
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/ameerj updated
https://github.com/llvm/llvm-project/pull/84988
>From 0d0868ddffe1b0668a57c10cc89614ab7c840634 Mon Sep 17 00:00:00 2001
From: ameerj
Date: Sat, 16 Mar 2024 17:03:47 -0400
Subject: [PATCH] [clang-format] Add BreakFunctionDefinitionParameters option
---
clang/d
https://github.com/ameerj created
https://github.com/llvm/llvm-project/pull/84988
This adds an option to break function definition parameters, putting them on
the next line after the function's opening paren.
This was a missing step towards allowing styles which require all function
definitio
45 matches
Mail list logo