[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-12-31 Thread Ameer J via cfe-commits
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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-12-31 Thread Ameer J via 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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-11-08 Thread Ameer J via 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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-23 Thread Ameer J via cfe-commits
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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-11 Thread Ameer J via 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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-10-04 Thread Ameer J via 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

[clang] [clang-format] clang-format-ignore: Add support for double asterisk patterns (PR #110560)

2024-09-30 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-08-09 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-08-05 Thread Ameer J via 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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-08-05 Thread Ameer J via 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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-29 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-23 Thread Ameer J via 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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-22 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-22 Thread Ameer J via 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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via 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

[clang] [clang-format] Add BreakBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via 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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via 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 __

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via 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/16] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-17 Thread Ameer J via 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/15] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-15 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-15 Thread Ameer J via 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/14] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-10 Thread Ameer J via 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/11] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-09 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-02 Thread Ameer J via 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/10] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Ameer J via 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/10] Add BinPackBinaryOperations --- clang/include/clang/Format/Format

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Ameer J via 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 1/9] Add BinPackBinaryOperations --- clang/include/clang/Format/Format.h

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Ameer J via 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 1/8] Add BinPackBinaryOperations --- clang/include/clang/Format/Format.h

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-07-01 Thread Ameer J via 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 1/7] Add BinPackBinaryOperations --- clang/include/clang/Format/Format.h

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-18 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-12 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-11 Thread Ameer J via 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 1/6] Add BinPackBinaryOperations --- clang/include/clang/Format/Format.h

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-11 Thread Ameer J via cfe-commits
@@ -1203,6 +1214,10 @@ unsigned ContinuationIndenter::addTokenOnNewLine(LineState &State, } } + if (!Style.BinPackBinaryOperations && Previous.is(TT_BinaryOperator) && + (Previous.getPrecedence() > prec::Conditional)) { +CurrentState.BreakBeforeParameter = tru

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-11 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BinPackBinaryOperations configuration (PR #95013)

2024-06-10 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-28 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-26 Thread Ameer J via 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 1/3] [clang-format] Add BreakFunctionDefinitionParameters option --- cl

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-26 Thread Ameer J via cfe-commits
@@ -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

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-26 Thread Ameer J via 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 1/2] [clang-format] Add BreakFunctionDefinitionParameters option --- cl

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-25 Thread Ameer J via cfe-commits
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

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-16 Thread Ameer J via 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

[clang] [clang-format] Add BreakFunctionDefinitionParameters option (PR #84988)

2024-03-12 Thread Ameer J via cfe-commits
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