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

2024-08-10 Thread Owen Pan via cfe-commits
https://github.com/owenca closed 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-10 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: Nah, I can't find a better name, which isn't a whole sentence. 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-09 Thread Owen Pan via cfe-commits
owenca 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 I wonder if anyone can come up with a better name than `OnePerLine`. See https://github.com/llvm/llvm-project/pull/101882#issuecomm

[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 Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. 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 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-08-04 Thread Owen Pan via cfe-commits
https://github.com/owenca 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-04 Thread Owen Pan via cfe-commits
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BreakBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations owenca wrote: ```suggest

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Token in an alignable binary operator +static bool isAlignableBinaryOperator(const FormatToken

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BreakBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && conditi

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -2231,6 +2231,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to break binary operations. + enum BreakBinaryOperationsStyle : int8_t { +/// Don't break binary operations +/// \code +///aaa + * ccc

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -2231,6 +2231,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to break binary operations. + enum BreakBinaryOperationsStyle : int8_t { +/// Don't break binary operations +/// \code +///aaa + * ccc

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -2231,6 +2231,41 @@ struct FormatStyle { /// \version 3.7 bool BreakBeforeTernaryOperators; + /// Different ways to break binary operations. + enum BreakBinaryOperationsStyle : int8_t { +/// Don't break binary operations +/// \code +///aaa + * ccc

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

2024-08-04 Thread Owen Pan via cfe-commits
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) { verifyFormat("return sizeof \"5\";"); } +TEST_F(FormatTest, BreakBinaryOperations) { + auto Style = getLLVMStyleWithColumns(60); + // Logical operations + verifyFormat("if (condition1 && conditi

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

2024-08-04 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: This patch also fixes #58014 and #57280, so you can include them in the commit message. https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

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

2024-08-04 Thread Owen Pan via cfe-commits
https://github.com/owenca 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-04 Thread Owen Pan via cfe-commits
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current, Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma)); } +// Returns \c true if \c Token in an alignable binary operator +static bool isAlignableBinaryOperator(const FormatToken

[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-19 Thread Björn Schäpers via cfe-commits
HazardyKnusperkeks wrote: Fine by me. The build states: Failed Tests (1): Clang-Unit :: Format/./FormatTests/ConfigParseTest/ParsesConfiguration Is this from this change? https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cf

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

2024-07-19 Thread via cfe-commits
https://github.com/mydeveloperday commented: I have no major objection I'll go with whatever @owenca and @HazardyKnusperkeks agree https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

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

2024-07-19 Thread via cfe-commits
https://github.com/mydeveloperday commented: I think the enum is clearer and leave you open to add new options as you did, thank you, https://github.com/llvm/llvm-project/pull/95013 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[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