[clang] [clang-format] Annotate ::operator as FunctionDeclarationName (PR #111115)

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

[clang] [clang-format] Handle template closer followed by empty paretheses (PR #110408)

2024-09-29 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/110408 >From 27135c008868cc4f17b7ca5ff9c2af9c2fc02135 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 28 Sep 2024 22:42:56 -0700 Subject: [PATCH 1/2] [clang-format] Handle template closer followed by empty parethese

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/111285 None >From 7745a5d103f73a093bd856d23b3fb1c4ef80d5ac Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 6 Oct 2024 02:27:59 -0700 Subject: [PATCH] [clang-format][NFC] Clean up AlignConsecutiveStyle --- clang/li

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -302,47 +302,46 @@ TEST(ConfigParseTest, ParsesConfiguration) { Style.FIELD.Enabled = true; \ CHECK_PARSE( \ #FIELD ": None", FIELD,

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

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

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: You can run `ninja clang-format-check-format` and/or `git clang-format HEAD~` before `git push`. https://github.com/llvm/llvm-project/pull/108241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

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

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -48,46 +48,62 @@ template <> struct MappingTraits { FormatStyle::AlignConsecutiveStyle( {/*Enabled=*/false, /*AcrossEmptyLines=*/false, /*AcrossComments=*/false, /*AlignCompound=*/false, - /*AlignF

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -20010,6 +20010,17 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { " return 0;\n" "}() };", BracedAlign); + + Alignment.AlignConsecutiveDeclarations.AlignFunctionDeclarations = false; + verifyFormat("unsigned int f1(void)

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -305,37 +305,43 @@ TEST(ConfigParseTest, ParsesConfiguration) { FormatStyle::AlignConsecutiveStyle( \ {/*Enabled=*/false, /*AcrossEmptyLines=*/false, \ /*AcrossComments=*/false, /*AlignC

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -305,37 +305,43 @@ TEST(ConfigParseTest, ParsesConfiguration) { FormatStyle::AlignConsecutiveStyle( \ {/*Enabled=*/false, /*AcrossEmptyLines=*/false, \ /*AcrossComments=*/false, /*AlignC

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Please update `clang/docs/ReleaseNotes.rst`. https://github.com/llvm/llvm-project/pull/108241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -305,37 +305,43 @@ TEST(ConfigParseTest, ParsesConfiguration) { FormatStyle::AlignConsecutiveStyle( \ {/*Enabled=*/false, /*AcrossEmptyLines=*/false, \ /*AcrossComments=*/false, /*AlignC

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -48,46 +48,62 @@ template <> struct MappingTraits { FormatStyle::AlignConsecutiveStyle( {/*Enabled=*/false, /*AcrossEmptyLines=*/false, /*AcrossComments=*/false, /*AlignCompound=*/false, - /*AlignF

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

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

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
@@ -20010,6 +20010,17 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { " return 0;\n" "}() };", BracedAlign); + + Alignment.AlignConsecutiveDeclarations.AlignFunctionDeclarations = false; + verifyFormat("unsigned int f1(void)

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/108241 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clang-format: Add AlignFunctionDeclarations attribute to AlignConsecutiveDeclarations (PR #108241)

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

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/111285 >From b1bcd59b45230dd3b82c09ae0a32ce45f2ff9bdc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 6 Oct 2024 02:27:59 -0700 Subject: [PATCH] [clang-format][NFC] Clean up AlignConsecutiveStyle --- clang/docs/Cla

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/111285 >From b1bcd59b45230dd3b82c09ae0a32ce45f2ff9bdc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 6 Oct 2024 02:27:59 -0700 Subject: [PATCH 1/2] [clang-format][NFC] Clean up AlignConsecutiveStyle --- clang/docs

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

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

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

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

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

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

[clang] [clang-format] Insert a space between l_paren and ref-qualifier (PR #111465)

2024-10-07 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/111465 Fixes #111346. >From 9d9405d55fbaeea13d80bb394402fee2f0ef34ca Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 7 Oct 2024 19:34:16 -0700 Subject: [PATCH] [clang-format] Insert a space between l_paren and ref-

[clang] [clang-format] Handle template opener/closer in braced list (PR #112494)

2024-10-16 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/112494 Fixes #112487. >From f4e0c6554ed63bfb2a1fd17411090ac06038ebc5 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Wed, 16 Oct 2024 01:07:14 -0700 Subject: [PATCH] [clang-format] Handle template opener/closer in braced

[clang] [clang-format] Fix a crash on C# `goto case` (PR #113056)

2024-10-19 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113056 Fixes #113011. >From dd3bba3760b74806871593c430f9c1f6b55cfe62 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sat, 19 Oct 2024 10:25:32 -0700 Subject: [PATCH] [clang-format] Fix a crash on C# `goto case` Fixes #1

[clang] [clang-format] Fix a bug that always returns error for JSON (PR #112839)

2024-10-18 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/112839 >From 9eb81c845aa102e28c87eeefe82fac3f029ae29e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 17 Oct 2024 21:52:16 -0700 Subject: [PATCH 1/3] [clang-format] Fix a bug that always returns error for JSON Fixe

[clang] [clang-format] Fix a bug that always returns error for JSON (PR #112839)

2024-10-18 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/112839 >From 9eb81c845aa102e28c87eeefe82fac3f029ae29e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 17 Oct 2024 21:52:16 -0700 Subject: [PATCH 1/2] [clang-format] Fix a bug that always returns error for JSON Fixe

[clang] [clang-format] Fix a bug that always returns error for JSON (PR #112839)

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

[clang] [clang-format] New clang-format-indent-mode for Emacs (PR #78904)

2024-10-20 Thread Owen Pan via cfe-commits
owenca wrote: > That's a great idea, I'll have to look into that more! @amygrinn Do you still need to go forward with this PR? https://github.com/llvm/llvm-project/pull/78904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

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

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

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

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

[clang] [llvm] [clang-format] Add CI check confirming ClangFormatStyleOptions.rst is up-to-date. (PR #111513)

2024-10-20 Thread Owen Pan via cfe-commits
owenca wrote: > > Because only part of the doc is generated by dump_format_style.py. > > It should still be possible to only include the non-generated parts in the > repo and then modify the script to add all the generated components on > afterwards as a build step? Not sure if I'm missing som

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-20 Thread Owen Pan via cfe-commits
owenca wrote: > > I'm inclined to think that all the AllowShort options should work the same > > way whether ColumnLimit is 0. However, a couple of them I checked > > (AllowShortLoops and AllowShortBlocks) have no effect unless set to false. > > I suggest that we mark the test as a FIXME or do

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

2024-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Please update the release notes. https://github.com/llvm/llvm-project/pull/109497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -50,33 +50,43 @@ template <> struct MappingTraits { {/*Enabled=*/true, /*AcrossEmptyLines=*/false, /*AcrossComments=*/false, /*AlignCompound=*/false, /*AlignFunctionDeclarations=*/true, - /*Al

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

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

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -20272,14 +20318,16 @@ TEST_F(FormatTest, AlignWithLineBreaks) { /*AcrossComments=*/false, /*AlignCompound=*/false, /*AlignFunctionDeclarations=*/false, /*AlignFunctionPointers=*/false, - /*PadOperators=*/tru

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -302,44 +302,44 @@ TEST(ConfigParseTest, ParsesConfiguration) { Style.FIELD.Enabled = true; \ CHECK_PARSE(#FIELD ": None", FIELD, \ FormatStyle::AlignConsecutiveSt

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -348,6 +348,7 @@ TEST(ConfigParseTest, ParsesConfiguration) { CHECK_PARSE_NESTED_BOOL(FIELD, AlignFunctionDeclarations); \ CHECK_PARSE_NESTED_BOOL(FIELD, AlignFunctionPointers); \ CHECK_PARSE_NESTED_BOOL(FIELD, PadOperators);

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -302,44 +302,44 @@ TEST(ConfigParseTest, ParsesConfiguration) { Style.FIELD.Enabled = true; \ CHECK_PARSE(#FIELD ": None", FIELD, \ FormatStyle::AlignConsecutiveSt

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -20272,14 +20318,16 @@ TEST_F(FormatTest, AlignWithLineBreaks) { /*AcrossComments=*/false, /*AlignCompound=*/false, /*AlignFunctionDeclarations=*/false, /*AlignFunctionPointers=*/false, - /*PadOperators=*/tru

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -275,13 +275,36 @@ struct FormatStyle { /// bbb >>= 2; /// \endcode bool PadOperators; +/// Only for ``AlignConsecutiveDeclarations``. Whether block comments +/// are aligned in declarations. +/// \code +/// true: +/// someLongFunction(

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -20029,6 +20029,52 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { Alignment); } +TEST_F(FormatTest, AlignConsecutiveDeclarationsBlockComments) { + FormatStyle Style = getLLVMStyleWithColumns(80); + Style.AlignConsecutiveDeclarations.Enabled = true; +

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -275,13 +275,36 @@ struct FormatStyle { /// bbb >>= 2; /// \endcode bool PadOperators; +/// Only for ``AlignConsecutiveDeclarations``. Whether block comments +/// are aligned in declarations. +/// \code +/// true: +/// someLongFunction(

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -50,33 +50,43 @@ template <> struct MappingTraits { {/*Enabled=*/true, /*AcrossEmptyLines=*/false, /*AcrossComments=*/false, /*AlignCompound=*/false, owenca wrote: ```suggestion /*AcrossComments=

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -275,13 +275,36 @@ struct FormatStyle { /// bbb >>= 2; /// \endcode bool PadOperators; +/// Only for ``AlignConsecutiveDeclarations``. Whether block comments +/// are aligned in declarations. +/// \code +/// true: +/// someLongFunction(

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -275,13 +275,36 @@ struct FormatStyle { /// bbb >>= 2; /// \endcode bool PadOperators; +/// Only for ``AlignConsecutiveDeclarations``. Whether block comments +/// are aligned in declarations. +/// \code +/// true: +/// someLongFunction(

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -20029,6 +20029,52 @@ TEST_F(FormatTest, AlignConsecutiveDeclarations) { Alignment); } +TEST_F(FormatTest, AlignConsecutiveDeclarationsBlockComments) { + FormatStyle Style = getLLVMStyleWithColumns(80); owenca wrote: ```suggestion auto St

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

2024-10-21 Thread Owen Pan via cfe-commits
@@ -89,6 +99,7 @@ template <> struct MappingTraits { Value.AlignFunctionDeclarations); IO.mapOptional("AlignFunctionPointers", Value.AlignFunctionPointers); IO.mapOptional("PadOperators", Value.PadOperators); +IO.mapOptional("AlignBlockComments",

[clang] [clang-format] Make bitwise and imply requires clause (PR #110942)

2024-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/110942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Fix a crash on C# `goto case` (PR #113056)

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

[clang] [clang-format] Handle C# `goto case` constructs (PR #113257)

2024-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113257 Fixes #113256. >From ae702403b55b23074dd881ef7735bfbe0a3c8eab Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 21 Oct 2024 20:18:43 -0700 Subject: [PATCH] [clang-format] Handle C# `goto case` constructs Fixes

[clang] [clang-format] Use RemoveEmptyLinesInUnwrappedLines in clang-format s… (PR #113260)

2024-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113260 …tyle >From 572848cfbed9273c0087f691bbc336af8e9a34e6 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 21 Oct 2024 20:30:28 -0700 Subject: [PATCH] [clang-format] Use RemoveEmptyLinesInUnwrappedLines in clang-f

[clang] [clang-format] Add KeepFormFeed option (PR #113268)

2024-10-21 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113268 Closes #113170. >From 0d1c2446a225d73e014e711b0d74931bff9237bc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 21 Oct 2024 23:27:35 -0700 Subject: [PATCH] [clang-format] Add KeepFormFeed option Closes #11317

[clang] [clang-format] Fix a bug that always returns error for JSON (PR #112839)

2024-10-17 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/112839 Fixes #108556. >From 9eb81c845aa102e28c87eeefe82fac3f029ae29e Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 17 Oct 2024 21:52:16 -0700 Subject: [PATCH] [clang-format] Fix a bug that always returns error for

[clang] [clang-format] Handle template opener/closer in braced list (PR #112494)

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

[clang] [clang-format] Add RemoveEmptyLinesInUnwrappedLines option (PR #112325)

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

[clang] [clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (PR #96804)

2024-10-09 Thread Owen Pan via cfe-commits
owenca wrote: @ichaer I forgot to mention that you would need to update `docs/ReleaseNotes.rst`. https://github.com/llvm/llvm-project/pull/96804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [clang-format][NFC] Clean up AlignConsecutiveStyle (PR #111285)

2024-10-06 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/111285 >From b1bcd59b45230dd3b82c09ae0a32ce45f2ff9bdc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 6 Oct 2024 02:27:59 -0700 Subject: [PATCH] [clang-format][NFC] Clean up AlignConsecutiveStyle --- clang/docs/Cla

[clang] [llvm] [clang-format] Add CI check confirming ClangFormatStyleOptions.rst is up-to-date. (PR #111513)

2024-10-09 Thread Owen Pan via cfe-commits
owenca wrote: > Also, why can't we just run the python script as part of building the docs > instead of committing the result of the script to the repository? Because only part of the doc is generated by `dump_format_style.py`. See https://github.com/llvm/llvm-project/blob/1809d0fa1c15b16ca943

[clang] [llvm] [clang-format] Add CI check confirming ClangFormatStyleOptions.rst is up-to-date. (PR #111513)

2024-10-09 Thread Owen Pan via cfe-commits
owenca wrote: > @owenca, see what you think. IMO it would be more helpful to add the build target to `lib/Format/CMakeLists.txt` instead. For example, ``` $ ninja FormatTests [1/1] cd /Users/Owen/llvm-project/clang12/bin/python3.12 dump_format_style.p $ ``` https://github.com/llvm/llvm-pr

[clang] [clang-format] Don't insert spaces after keywords in protobuf field o… (PR #111229)

2024-10-04 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/111229 …ptions Fixes #54848. >From 8849f09458363a96dc3dd080b9e87aa785f6958f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 4 Oct 2024 21:21:43 -0700 Subject: [PATCH] [clang-format] Don't insert spaces after keywor

[clang] [clang-format] Fix a bug that misannotates binary operators */&/&& (PR #110945)

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

[clang] Support BasedOnStyle referencing an arbitrary file (PR #110634)

2024-10-23 Thread Owen Pan via cfe-commits
owenca wrote: Please see https://github.com/llvm/llvm-project/issues/107808#issuecomment-2431139406. https://github.com/llvm/llvm-project/pull/110634 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [clang-format] Fix working -assume-filename with .clang-format-ignore (PR #113100)

2024-10-22 Thread Owen Pan via cfe-commits
owenca wrote: Also, the main purpose of `-assume-filename` is to set the language for input from stdin, and IMO the pseudo filename should not be filtered out by any .clang-format-ignore file. https://github.com/llvm/llvm-project/pull/113100 ___ cfe-

[clang] [clang-format] Handle C# `goto case` constructs (PR #113257)

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

[clang] [clang-format] Add KeepFormFeed option (PR #113268)

2024-10-22 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/113268 >From 0d1c2446a225d73e014e711b0d74931bff9237bc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 21 Oct 2024 23:27:35 -0700 Subject: [PATCH 1/2] [clang-format] Add KeepFormFeed option Closes #113170. --- clang

[clang] [clang-format] Use RemoveEmptyLinesInUnwrappedLines in clang-format s… (PR #113260)

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

[clang] [clang-format] Add KeepFormFeed option (PR #113268)

2024-10-22 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/113268 >From 0d1c2446a225d73e014e711b0d74931bff9237bc Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Mon, 21 Oct 2024 23:27:35 -0700 Subject: [PATCH 1/3] [clang-format] Add KeepFormFeed option Closes #113170. --- clang

[clang] [clang-format] Add KeepFormFeed option (PR #113268)

2024-10-22 Thread Owen Pan via cfe-commits
owenca wrote: > wow I've never seen this used, but this looks fine to me. Form feeds can be useful for emas/vim users and are recommended by the GNU Coding Standards. https://github.com/llvm/llvm-project/pull/113268 ___ cfe-commits mailing list cfe-c

[clang] [llvm] [clang-format] Add CI check confirming ClangFormatStyleOptions.rst is up-to-date. (PR #111513)

2024-10-11 Thread Owen Pan via cfe-commits
owenca wrote: > > IMO it would be more helpful to add the build target to > > lib/Format/CMakeLists.txt instead. For example, > > ``` > $ ninja FormatTests > ``` > > Moving the target from `clang/docs/CMakeLists.txt` to > `lib/Format/CMakeLists.txt` sounds great to me, but the testing part of

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

2024-10-14 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: Please update the release notes. 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)

2024-10-14 Thread Owen Pan via cfe-commits
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) { TT_StructLBrace, TT_UnionLBrace); } +bool LineStartsNamespaceScope(const AnnotatedLine *Line, + const AnnotatedLine *PreviousLine, +

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + + // Empty namespace. + verifyFormat("namespace

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + + // Empty namespace. + verifyFormat("namespace

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + + // Empty namespace. + verifyFormat("namespace

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + owenca wrote: ```suggestion S

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + auto Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + + // Empty namespace. + verifyFormat("namespace

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

2024-10-14 Thread Owen Pan via cfe-commits
@@ -1493,6 +1513,28 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Modify empty lines after "{" that opens namespace scope. + if (Style.WrapNamespaceBodyWithEmptyLines != FormatStyle::WNBWELS_Leave && + LineStartsNamespaceScope(&Lin

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

2024-10-14 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] Print the names of unfound files in error messages (PR #113640)

2024-10-24 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113640 Fixes #113631. >From 274b7cbdd8989c9f34c3df4041fa9098857bcc89 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 24 Oct 2024 20:05:52 -0700 Subject: [PATCH] [clang-format] Print the names of unfound files in err

[clang] [clang-format] Print the names of unfound files in error messages (PR #113640)

2024-10-24 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/113640 >From 274b7cbdd8989c9f34c3df4041fa9098857bcc89 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Thu, 24 Oct 2024 20:05:52 -0700 Subject: [PATCH 1/2] [clang-format] Print the names of unfound files in error messages

[clang] [clang-format] add MaxSingleLinesInBracedList style option (PR #112482)

2024-10-24 Thread Owen Pan via cfe-commits
owenca wrote: > There will be bugs if/when people use this option with small values for the > limit, as it will interact weirdly with both the braced list initializer > formatting rules, and also with the `AvoidBinPacking` logic of the > continuation indenter. Can you give some examples? h

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

2024-10-24 Thread Owen Pan 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: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

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

[clang] [llvm] [clang-format] Add CI check confirming ClangFormatStyleOptions.rst is up-to-date. (PR #111513)

2024-10-25 Thread Owen Pan via cfe-commits
https://github.com/owenca commented: @ichaer I suggest that you split the workflow part to another patch so that we can get the cmake part approved. https://github.com/llvm/llvm-project/pull/111513 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [clang-format] Add ConfigFile option (PR #113864)

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

[clang] [clang-format] Add ConfigFile option (PR #113864)

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

[clang] [clang-format] Add -ConfigFile option (PR #113864)

2024-10-30 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/113864 >From 85f78a4879a37fb367dccd5299b35d1c75c2b46f Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Oct 2024 22:22:11 -0700 Subject: [PATCH] [clang-format] Add ConfigFile option Closes #107808. --- clang/docs/

[clang] [clang-format] Add -ConfigFile option (PR #113864)

2024-10-30 Thread Owen Pan via cfe-commits
@@ -2102,6 +2108,17 @@ std::error_code parseConfiguration(llvm::MemoryBufferRef Config, StyleSet.Add(std::move(DefaultStyle)); } *Style = *StyleSet.Get(Language); + std::string ConfigFile; + if (!Style->ConfigFile.empty()) { owenca wrote: ```suggest

[clang] [NFC] Remove references to deleted `ClangFormattedStatus` file (PR #114331)

2024-10-30 Thread Owen Pan via cfe-commits
https://github.com/owenca approved this pull request. https://github.com/llvm/llvm-project/pull/114331 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't re-annotate CaseLabelColon as ConditionalExpr (PR #114639)

2024-11-01 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/114639 Fixes #114627. >From 146969dc5c1b3fd02c783118664e9cdb74aabbdf Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Fri, 1 Nov 2024 21:18:03 -0700 Subject: [PATCH] [clang-format] Don't re-annotate CaseLabelColon as Con

[clang] [clang-format] Fix a regression in parsing `switch` in macro call (PR #114506)

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

[clang] Fix clang-format-test.el past 625841c (PR #106398)

2024-11-02 Thread Owen Pan via cfe-commits
owenca wrote: > Race condition! Will update the other PR. @dklimkin can you link to "the other PR"? Should we revert this one now? cc @mydeveloperday @HazardyKnusperkeks https://github.com/llvm/llvm-project/pull/106398 ___ cfe-commits mailing list cf

[clang] [emacs][clang-format] Add elisp API for clang-format on git diffs (PR #112792)

2024-11-02 Thread Owen Pan via cfe-commits
owenca wrote: @ideasman42 can you review this PR? Thanks! https://github.com/llvm/llvm-project/pull/112792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-format] Don't re-annotate CaseLabelColon as ConditionalExpr (PR #114639)

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

[clang] 25af8f5 - [clang-format][doc] Fix a typo

2024-11-02 Thread Owen Pan via cfe-commits
Author: Owen Pan Date: 2024-11-02T14:48:35-07:00 New Revision: 25af8f535edd59ec12a404954db233e2e65e8d9b URL: https://github.com/llvm/llvm-project/commit/25af8f535edd59ec12a404954db233e2e65e8d9b DIFF: https://github.com/llvm/llvm-project/commit/25af8f535edd59ec12a404954db233e2e65e8d9b.diff LOG:

[clang] [clang-format] Add -ConfigFile option (PR #113864)

2024-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca updated https://github.com/llvm/llvm-project/pull/113864 >From b5f89c18b22bbc07d2f4fcbc2896996efea52478 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Oct 2024 22:22:11 -0700 Subject: [PATCH] [clang-format] Add -ConfigFile option Close #107808. --- clang/inclu

[clang] [clang-format] Add -ConfigFile option (PR #113864)

2024-10-27 Thread Owen Pan via cfe-commits
https://github.com/owenca created https://github.com/llvm/llvm-project/pull/113864 Close #107808. >From 4cbc31029c5d773dd68c80030e896b3fed88ab77 Mon Sep 17 00:00:00 2001 From: Owen Pan Date: Sun, 27 Oct 2024 22:22:11 -0700 Subject: [PATCH] [clang-format] Add -ConfigFile option Close #107808.

<    12   13   14   15   16   17   18   19   20   21   >