[clang] [clang-format] Fix option `BreakBinaryOperations` for operator `>>` (PR #122282)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix option `BreakBinaryOperations` for operator `>>` (PR #122282)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix option `BreakBinaryOperations` for operator `>>` (PR #122282)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix option `BreakBinaryOperations` for operator `>>` (PR #122282)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definitions (PR #123279)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/123279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Correctly annotate braces in macro definitions (PR #123279)

2025-01-17 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/123279 >From 04b03d24d661dc8e8503269b7ddf55140e88de20 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 16 Jan 2025 19:45:33 -0800 Subject: [PATCH 1/2] [clang-format] Correctly annotate braces in macro definitions Fi

[clang] [clang-format] Fix misannotations of `<` in ternary expressions (PR #100980)

2025-01-16 Thread Owen Pan via cfe-commits
owenca wrote: See https://github.com/llvm/llvm-project/issues/123144#issuecomment-2597430287. https://github.com/llvm/llvm-project/pull/100980 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-16 Thread Owen Pan via cfe-commits
@@ -28188,6 +28188,17 @@ TEST_F(FormatTest, BreakBinaryOperations) { " | byte_buffer[2] << 16\n" " | byte_buffer[3] << 24;", Style); + + Style.BreakBinaryOperations = FormatStyle::BBO_OnePerLine; +

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-16 Thread Owen Pan via cfe-commits
@@ -28188,6 +28188,17 @@ TEST_F(FormatTest, BreakBinaryOperations) { " | byte_buffer[2] << 16\n" " | byte_buffer[3] << 24;", Style); + + Style.BreakBinaryOperations = FormatStyle::BBO_OnePerLine; +

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-16 Thread Owen Pan via cfe-commits
@@ -147,7 +147,8 @@ static bool startsNextOperand(const FormatToken &Current) { // Returns \c true if \c Current is a binary operation that must break. static bool mustBreakBinaryOperation(const FormatToken &Current, const FormatStyle &Style

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-16 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-16 Thread Owen Pan via cfe-commits
@@ -147,7 +147,8 @@ static bool startsNextOperand(const FormatToken &Current) { // Returns \c true if \c Current is a binary operation that must break. static bool mustBreakBinaryOperation(const FormatToken &Current, const FormatStyle &Style

[clang] [clang-format] Correctly annotate braces in macro definitions (PR #123279)

2025-01-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/123279 Fixes #123179. >From 04b03d24d661dc8e8503269b7ddf55140e88de20 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 16 Jan 2025 19:45:33 -0800 Subject: [PATCH] [clang-format] Correctly annotate braces in macro defi

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-14 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-14 Thread Owen Pan via cfe-commits
@@ -28188,6 +28188,16 @@ TEST_F(FormatTest, BreakBinaryOperations) { " | byte_buffer[2] << 16\n" " | byte_buffer[3] << 24;", Style); + + Style.BreakBinaryOperations = FormatStyle::BBO_OnePerLine; +

[clang] [clang-format] Fix greatergreater (PR #122282)

2025-01-14 Thread Owen Pan via cfe-commits
@@ -28188,6 +28188,17 @@ TEST_F(FormatTest, BreakBinaryOperations) { " | byte_buffer[2] << 16\n" " | byte_buffer[3] << 24;", Style); owenca wrote: ```suggestion Style

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-13 Thread Owen Pan via cfe-commits
@@ -2252,6 +2252,25 @@ struct FormatStyle { /// \version 16 BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon; + /// If ``true``, a line break will be placed before the ``>`` in a multiline + /// template declaration. + /// \code + ///true: + ///templat

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-13 Thread Owen Pan via cfe-commits
owenca wrote: Why doesn't it break before the `>` for the example (a.cc) below? ```cpp template class C { void f() {} }; ``` Command line: ``` clang-format -style='{BreakBeforeTemplateCloser: Multiline, ColumnLimit: 26}' a.cc ``` https://github.com/llvm/llvm-project/pull/118046 _

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-12 Thread Owen Pan via cfe-commits
@@ -2252,6 +2252,25 @@ struct FormatStyle { /// \version 16 BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon; + /// If ``true``, a line break will be placed before the ``>`` in a multiline + /// template declaration. + /// \code + ///true: + ///templat

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
@@ -2252,6 +2252,25 @@ struct FormatStyle { /// \version 16 BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon; + /// If ``true``, a line break will be placed before the ``>`` in a multiline + /// template declaration. + /// \code + ///true: + ///templat

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2025-01-11 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2025-01-11 Thread Owen Pan via cfe-commits
owenca wrote: > rebased but still required to be tested and fix again See https://github.com/llvm/llvm-project/pull/93634#discussion_r1912374181. https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2025-01-11 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/93634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)

2025-01-11 Thread Owen Pan via cfe-commits
@@ -4493,13 +4493,11 @@ struct FormatStyle { bool SpaceBeforeRangeBasedForLoopColon; /// If ``true``, spaces will be inserted into ``{}``. - /// \code - ///true:false: - ///void f() { } vs. void f() {} - ///

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/118046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
@@ -6,6 +6,275 @@ TEST_F(FormatTest, WrapsTemplateDeclarationsWithComments) { Style); } +TEST_F(FormatTest, BreakBeforeTemplateClose) { + FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp); + // Begin with tests covering the case where there is no constra

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
@@ -2252,6 +2252,25 @@ struct FormatStyle { /// \version 16 BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon; + /// If ``true``, a line break will be placed before the ``>`` in a multiline + /// template declaration. + /// \code + ///true: + ///templat

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
@@ -2252,6 +2252,25 @@ struct FormatStyle { /// \version 16 BreakBeforeInlineASMColonStyle BreakBeforeInlineASMColon; + /// If ``true``, a line break will be placed before the ``>`` in a multiline + /// template declaration. + /// \code + ///true: + ///templat

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: You can run `ninja clang-format-check-format` to make sure your patch is correctly formatted before pushing. https://github.com/llvm/llvm-project/pull/118046 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-11 Thread Owen Pan via cfe-commits
owenca wrote: > > I think this should be covered by BlockIndent > > My understanding from looking at past PRs to clang-format was that backwards > compatibility was a top requirement. If I changed the behavior of BlockIndent > to put the `>` on the next line, that would change a lot of existin

[clang] Fix greatergreater (PR #122282)

2025-01-10 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: With `ColumnLimit: 60`, this patch doesn't seem to format the following correctly: `std::cout << longOperand_1 << longOperand_2 << longOperand_3;` https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits m

[clang] Fix greatergreater (PR #122282)

2025-01-10 Thread Owen Pan via cfe-commits
@@ -28188,6 +28188,16 @@ TEST_F(FormatTest, BreakBinaryOperations) { " | byte_buffer[2] << 16\n" " | byte_buffer[3] << 24;", Style); + + Style.BreakBinaryOperations = FormatStyle::BBO_OnePerLine; +

[clang] Fix greatergreater (PR #122282)

2025-01-10 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/122282 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-10 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: About the test cases: - Call `verifyFormat` instead of `verifyNoChange` whenever possible. - Don't end a test case with a newline. (Search for `\n",` and `\n")`.) - Capitalize the first word of a comment and end the comment with a `.` (or `:` if appropriate).

[clang] [clang-format] Add BreakBeforeTemplateClose option (PR #118046)

2025-01-10 Thread Owen Pan via cfe-commits
owenca wrote: > > Maybe we should make it a sub-option for `BlockIndent`. I'm seeing a > > possible need for having control over other kinds of block indented > > structures such as Lambdas. I suspect the way this option has been > > implemented it interacts with the alignment options anyway.

[clang] [clang-format] Stop fixing indentation on namespace closing brace (PR #122234)

2025-01-09 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/122234 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] f926bcf - [clang-format][doc] Fix the description of BreakBinaryOperations

2025-01-09 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2025-01-09T18:56:42-08:00 New Revision: f926bcf9068c808b643a56322b7ef6910eb36599 URL: https://github.com/llvm/llvm-project/commit/f926bcf9068c808b643a56322b7ef6910eb36599 DIFF: https://github.com/llvm/llvm-project/commit/f926bcf9068c808b643a56322b7ef6910eb36599.diff LOG:

[clang] [clang-format] Stop fixing indentation on namespace closing brace (PR #122234)

2025-01-09 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/122234 Fixes #119790. >From 38b8ebca922a7511d9f2bc048f3df0c9863cafc8 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 9 Jan 2025 00:16:30 -0800 Subject: [PATCH] [clang-format] Stop fixing indentation on namespace clo

[clang] 064da42 - [clang-format][NFC] Remove unneeded ST_ChildBlock in annotator

2025-01-07 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2025-01-07T00:51:29-08:00 New Revision: 064da423c3b46907f5011a4537a88fbae9ac03d4 URL: https://github.com/llvm/llvm-project/commit/064da423c3b46907f5011a4537a88fbae9ac03d4 DIFF: https://github.com/llvm/llvm-project/commit/064da423c3b46907f5011a4537a88fbae9ac03d4.diff LOG:

[clang] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement (PR #121681)

2025-01-06 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement (PR #121681)

2025-01-06 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121681 >From 14e26d9bb27724705e51fc134a4f3df2a09807e6 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 4 Jan 2025 23:42:38 -0800 Subject: [PATCH 1/2] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement

[clang] [clang-format] Add an option to control indentation of `export { ... }` (PR #110381)

2025-01-05 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/110381 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement (PR #121681)

2025-01-05 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121681 >From 14e26d9bb27724705e51fc134a4f3df2a09807e6 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 4 Jan 2025 23:42:38 -0800 Subject: [PATCH] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement The

[clang] [clang-format] Add LT_RequiresExpression and LT_SimpleRequirement (PR #121681)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121681 The new line types help to annotate */&/&& in simple requirements as binary operators. Fixes #121675. >From bdf0c2e2a9fd78368137e441cc4cad33702fbdc7 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 4 Jan 202

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add TT_AfterPPDirective for better annotation (PR #121622)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't break short macro call followed by l_paren (PR #121626)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Replace SmallVectorImpl with ArrayRef (PR #121621)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Add missing config tests for List of Strings (PR #121451)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format][NFC] Add missing config tests for List of Strings (PR #121451)

2025-01-04 Thread Owen Pan via cfe-commits
owenca wrote: > these tests are so inconsistent but I guess it's not that critical See the added commit message. https://github.com/llvm/llvm-project/pull/121451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang-format][NFC] Add missing config tests for List of Strings (PR #121451)

2025-01-04 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-04 Thread Owen Pan via cfe-commits
owenca wrote: > This is a good fix but I think it might not be addressing the whole issue. > This isn't a problem with just _compound-requirement_, it's the case for > _simple-requirement_s too. This patch fixes compound requirements as mentioned in the commit message and reported in the GitH

[clang] [clang-format] Don't break short macro call followed by l_paren (PR #121626)

2025-01-03 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix bug assuming short macro call without semicolon (PR #121626)

2025-01-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121626 Fixes #105658. >From 6c95c2213467ad013406c7b8b9d9ff709a38e047 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 3 Jan 2025 22:35:38 -0800 Subject: [PATCH] [clang-format] Fix bug assuming short macro call withou

[clang] Add support for aligning BlockComments in declarations (PR #109497)

2025-01-03 Thread Owen Pan via cfe-commits
@@ -1022,7 +1028,10 @@ void WhitespaceManager::alignConsecutiveDeclarations() { if (C.Tok->is(TT_FunctionDeclarationName)) return Style.AlignConsecutiveDeclarations.AlignFunctionDeclarations; if (C.Tok->isNot(TT_StartOfName)) - return false; +

[clang] Add support for aligning BlockComments in declarations (PR #109497)

2025-01-03 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/109497 >From 38333491868dfad9c84719d9dd8fd872a2aa7584 Mon Sep 17 00:00:00 2001 From: Jesse Harvey Date: Fri, 20 Sep 2024 16:40:35 -0700 Subject: [PATCH 1/4] Add support for aligning BlockComments in declarations --- c

[clang] [clang-format] Add TT_AfterPPDirective for better annotation (PR #121622)

2025-01-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121622 For now, we only need to annotate the token after #error or #warning. Fixes #117706. >From 9daceef16b0a387257713d1a379782598d537fd9 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 3 Dec 2024 01:40:56 -0800 S

[clang] [clang-format][NFC] Replace SmallVectorImpl with ArrayRef (PR #121621)

2025-01-03 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121621 None >From 4c410b4f442e956f354f3e826d61733f85e8f390 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 30 Dec 2024 01:59:32 -0800 Subject: [PATCH] [clang-format][NFC] Replace SmallVectorImpl with ArrayRef ---

[clang] 34f0611 - [clang-format][doc] Minor cleanup

2025-01-03 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2025-01-03T20:10:33-08:00 New Revision: 34f0611bc36db40789823030a3748a8595198719 URL: https://github.com/llvm/llvm-project/commit/34f0611bc36db40789823030a3748a8595198719 DIFF: https://github.com/llvm/llvm-project/commit/34f0611bc36db40789823030a3748a8595198719.diff LOG:

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106145 >From dde31f15552cb4f95a50e0835238062a0e6c69d8 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 01/12] fix merge conflict --- clang/docs/ClangFormatStyleOptions.rst

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106145 >From dde31f15552cb4f95a50e0835238062a0e6c69d8 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 01/11] fix merge conflict --- clang/docs/ClangFormatStyleOptions.rst

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/106145 >From dde31f15552cb4f95a50e0835238062a0e6c69d8 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 01/10] fix merge conflict --- clang/docs/ClangFormatStyleOptions.rst

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `TT_CompoundRequirementLBrace` for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121539 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add CompoundRequirementLBrace for better annotation (PR #121539)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121539 Also, add ST_CompoundRequirement so that */&/&& in compound requirement expressions are annotated as PointerOrReference. Fixes #121471. >From 17c784954e9352738368adb29f85788b06e66b4d Mon Sep 17 00:00:00 2001 Fr

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Also, please address https://github.com/llvm/llvm-project/pull/106145#pullrequestreview-2365418005. https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread Owen Pan via cfe-commits
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW

[clang] [clang-format] extend clang-format directive with options to prevent formatting for one line (PR #118566)

2025-01-01 Thread Owen Pan via cfe-commits
owenca wrote: > > If we were to add // clang-format off-next-line, would "next line" mean the > > next physical or logical/unwrapped line? > > I would expect it to apply only to the physical line, similar to how other > formatters work. However, the main concern doesn’t seem to be about its >

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2025-01-01 Thread Owen Pan via cfe-commits
owenca wrote: > > Should there be a parse test? > > About half of the `List of Strings` options don't have a `CHECK_PARSE` test. > I'll fix that in a separate patch. See #121451. https://github.com/llvm/llvm-project/pull/121318 ___ cfe-commits maili

[clang] [clang-format][NFC] Add missing config tests for List of Strings (PR #121451)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121451 None >From 305aacf68126a7827376a0718a774006f10879f4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 1 Jan 2025 20:15:26 -0800 Subject: [PATCH] [clang-format][NFC] Add missing config tests for List of Strings

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121318 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Repair the function "rParenEndsCast" to make incorrect judgments in template variable cases (PR #120904)

2025-01-01 Thread Owen Pan via cfe-commits
owenca wrote: See #121318. https://github.com/llvm/llvm-project/pull/120904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2025-01-01 Thread Owen Pan via cfe-commits
owenca wrote: > Should there be a parse test? About half of the `List of Strings` options don't have a `CHECK_PARSE` test. I'll fix that in a separate patch. https://github.com/llvm/llvm-project/pull/121318 ___ cfe-commits mailing list cfe-commits@li

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From 7e865d66f147da3afa1ebcd55354e97fdfd8374a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/121404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From 36efaa2849ee6276be5b3c0739f295d0921d1e6e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH 1/4] [clang-format] Support globstar in .clang-format-ignore Closes #1

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2025-01-01 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From 36efaa2849ee6276be5b3c0739f295d0921d1e6e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH 1/3] [clang-format] Support globstar in .clang-format-ignore Closes #1

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2025-01-01 Thread Owen Pan via cfe-commits
@@ -164,6 +164,41 @@ TEST_F(MatchFilePathTest, Path) { EXPECT_FALSE(match("foo\\", R"(foo*\)")); } +TEST_F(MatchFilePathTest, Globstar) { + EXPECT_TRUE(match("/", "**")); + EXPECT_TRUE(match("foo", "**")); + EXPECT_TRUE(match("/foo", "**")); + EXPECT_TRUE(match("foo/", "

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/121404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From 36efaa2849ee6276be5b3c0739f295d0921d1e6e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH 1/2] [clang-format] Support globstar in .clang-format-ignore Closes #1

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
@@ -164,6 +164,41 @@ TEST_F(MatchFilePathTest, Path) { EXPECT_FALSE(match("foo\\", R"(foo*\)")); } +TEST_F(MatchFilePathTest, Globstar) { + EXPECT_TRUE(match("/", "**")); + EXPECT_TRUE(match("foo", "**")); + EXPECT_TRUE(match("/foo", "**")); + EXPECT_TRUE(match("foo/", "

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From 36efaa2849ee6276be5b3c0739f295d0921d1e6e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH] [clang-format] Support globstar in .clang-format-ignore Closes #11496

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From 13c13f02e55c39db1376c8e8cfb1d1ab90287502 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH] [clang-format] Support globstar in .clang-format-ignore Closes #11496

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

2024-12-31 Thread Owen Pan via cfe-commits
owenca wrote: See #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] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121404 >From a1060e903d29340840cdd0a9cecf74269fc7c563 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH] [clang-format] Support globstar in .clang-format-ignore Closes #11496

[clang] [clang-format] Support globstar in .clang-format-ignore (PR #121404)

2024-12-31 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/121404 Closes #114969. >From 8b7802141853f77f3f074e6f41f416dfd25d90e4 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Tue, 31 Dec 2024 08:13:53 -0800 Subject: [PATCH] [clang-format] Support globstar in .clang-format-igno

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From 7e865d66f147da3afa1ebcd55354e97fdfd8374a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From 7e865d66f147da3afa1ebcd55354e97fdfd8374a Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From abbe00e409219bcc3ce08c21548d809c9d5bea39 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From abbe00e409219bcc3ce08c21548d809c9d5bea39 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From 8f61998f9a5339a9c1c04176bf3d74331532eb75 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add `VariableTemplates` option (PR #121318)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/121318 >From 8f61998f9a5339a9c1c04176bf3d74331532eb75 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 29 Dec 2024 20:17:46 -0800 Subject: [PATCH] [clang-format] Add VariableTemplate option Closes #120148. --- clang

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-12-30 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Please enable "Allowing edits by maintainers". https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-12-30 Thread Owen Pan via cfe-commits
@@ -1493,6 +1493,22 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + if (Style.WrapNamespaceBodyWithEmptyLines != FormatStyle::WNBWELS_Leave) { +// Modify empty lines after TT_NamespaceLBrace. +if (PreviousLine && PreviousLine->endsWit

[clang] [clang-format] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-12-30 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,138 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.WrapNamespaceBodyWithEmptyLines = FormatSt

  1   2   3   4   5   6   7   8   9   10   >