Author: Owen Pan
Date: 2024-11-25T00:35:50-08:00
New Revision: 0fe12a7db3f6663c9f2572ff0232e56f1bd411ae
URL:
https://github.com/llvm/llvm-project/commit/0fe12a7db3f6663c9f2572ff0232e56f1bd411ae
DIFF:
https://github.com/llvm/llvm-project/commit/0fe12a7db3f6663c9f2572ff0232e56f1bd411ae.diff
LOG:
Author: Owen Pan
Date: 2024-11-28T22:00:23-08:00
New Revision: 9b5b3edd64e56af02295c0365269177443d4a64d
URL:
https://github.com/llvm/llvm-project/commit/9b5b3edd64e56af02295c0365269177443d4a64d
DIFF:
https://github.com/llvm/llvm-project/commit/9b5b3edd64e56af02295c0365269177443d4a64d.diff
LOG:
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/117472
Fixes #117290.
>From 9a2a93fbb50163e593f6b48a279bea9f70424c06 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 24 Nov 2024 00:43:29 -0800
Subject: [PATCH] [clang-format] Fix an assertion failure in RemoveSemic
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/117730
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/117730
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> As a reviewer that means we have to download the review, rebuild the rst then
> check it. I don't quite understand the problem we are trying to solve here?
> Given that the python script unpacks the Format.h and makes the rst I would
> prefer to see the finished rst as part of
owenca wrote:
> Can you explicate on what your requirements are here? I don't see why just
> wrapping the python script in CMake does anything tangible here. Having a
> build target that modifies the source directory is also weird and something
> that we should avoid if possible, in my opinion
owenca wrote:
> What's the point of adding it to the `FormatTests` target though? Just to
> ensure proper test coverage of the `dump_format_style.py` file?
That and to also ensure that the edited Format.h doesn't break the python
script.
> Thinking about this a bit more, I think we can probab
owenca wrote:
You need to also update the command-line input file extensions, docs, and
git-clang-format.
https://github.com/llvm/llvm-project/pull/118188
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
Author: Owen Pan
Date: 2024-11-24T23:15:39-08:00
New Revision: b9731a479cb053cd07cc5f460b097c5f2d5f396e
URL:
https://github.com/llvm/llvm-project/commit/b9731a479cb053cd07cc5f460b097c5f2d5f396e
DIFF:
https://github.com/llvm/llvm-project/commit/b9731a479cb053cd07cc5f460b097c5f2d5f396e.diff
LOG:
@@ -87,7 +87,7 @@ static cl::opt AssumeFileName(
"supported:\n"
" CSharp: .cs\n"
" Java: .java\n"
- " JavaScript: .mjs .js .ts\n"
+ " JavaScript: .cjs .mjs .js .ts\n"
owenca wrote:
```suggestio
@@ -94,7 +94,7 @@ def main():
# Other languages that clang-format supports
'proto', 'protodevel', # Protocol Buffers
'java', # Java
- 'mjs', 'js', # JavaScript
+ 'cjs', 'mjs', 'js', # JavaScript
owenca wrote:
```suggestion
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/118188
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -49,7 +49,7 @@ to format C/C++/Java/JavaScript/JSON/Objective-C/Protobuf/C#
code.
supported:
CSharp: .cs
Java: .java
- Ja
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/118513
Fixes #118334.
>From 309952ef482ccbef6cd13f90388139db435b4368 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 3 Dec 2024 08:51:13 -0800
Subject: [PATCH] [clang-format] Fix idempotent format of hash in macro b
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/118188
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/118188
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited
https://github.com/llvm/llvm-project/pull/111513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
Ping @mydeveloperday @HazardyKnusperkeks
https://github.com/llvm/llvm-project/pull/117472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -53,3 +53,13 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+set(style_options_depends ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
+add_custom_command(OUTPUT ${style_options_depends}
--
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/111513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/111513
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/118154
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -53,3 +53,13 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+set(style_options_depends ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
+add_custom_command(OUTPUT ${style_options_depends}
+
@@ -53,3 +53,13 @@ foreach (file IN LISTS files)
endforeach ()
add_custom_target(clang-format-check-format DEPENDS ${check_format_depends})
+
+set(style_options_depends ${CLANG_SOURCE_DIR}/docs/ClangFormatStyleOptions.rst)
+add_custom_command(OUTPUT ${style_options_depends}
+
Author: Owen Pan
Date: 2024-12-08T01:15:45-08:00
New Revision: eeadd0128df848eb858ae718984a13fa2c923775
URL:
https://github.com/llvm/llvm-project/commit/eeadd0128df848eb858ae718984a13fa2c923775
DIFF:
https://github.com/llvm/llvm-project/commit/eeadd0128df848eb858ae718984a13fa2c923775.diff
LOG:
Author: Owen Pan
Date: 2024-12-07T22:41:50-08:00
New Revision: 6b1c357acc312961743bef05f99120e7c68b2e25
URL:
https://github.com/llvm/llvm-project/commit/6b1c357acc312961743bef05f99120e7c68b2e25
DIFF:
https://github.com/llvm/llvm-project/commit/6b1c357acc312961743bef05f99120e7c68b2e25.diff
LOG:
@@ -6105,6 +6105,33 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return false;
}
+ // We only break before r_brace if there was a corresponding break before
+ // the l_brace, which is tracked by BreakBeforeClosingBrace.
owenca w
@@ -9383,6 +9383,13 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"(a, )) &&\n"
");",
Style);
+ verifyFormat("void foo(\n"
+ "void (*foobarpntr)(\n"
+
@@ -6105,6 +6105,33 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return false;
}
+ // We only break before r_brace if there was a corresponding break before
+ // the l_brace, which is tracked by BreakBeforeClosingBrace.
+ if (Right.is(tok::r_br
Author: Owen Pan
Date: 2024-12-05T23:18:24-08:00
New Revision: e25c556abeb9ae5f82da42cd26b9dae8462a7197
URL:
https://github.com/llvm/llvm-project/commit/e25c556abeb9ae5f82da42cd26b9dae8462a7197
DIFF:
https://github.com/llvm/llvm-project/commit/e25c556abeb9ae5f82da42cd26b9dae8462a7197.diff
LOG:
Author: Owen Pan
Date: 2024-12-05T19:38:34-08:00
New Revision: f0b09dfd4c84fe8ffbc726da39ee5255e1a22a2f
URL:
https://github.com/llvm/llvm-project/commit/f0b09dfd4c84fe8ffbc726da39ee5255e1a22a2f
DIFF:
https://github.com/llvm/llvm-project/commit/f0b09dfd4c84fe8ffbc726da39ee5255e1a22a2f.diff
LOG:
owenca wrote:
> If CLANG_INCLUDE_DOCS=OFF then this should be skipped, otherwise the build
> will fail if llvm/clang/docs doesn't exist.
This was fixed in f0b09dfd4c84fe8ffbc726da39ee5255e1a22a2f, which also
addressed an issue that ClangFormatStyleOptions.rst would be deleted by `ninja
clean`
owenca wrote:
> When running the new testcase the file plurals.txt, which is in the repo, is
> opened for writing? Is this really desired?
Fixed in 74d29c6393df606e98e7c42b9a97f56f335e3ffb.
https://github.com/llvm/llvm-project/pull/118154
___
cfe-com
Author: Owen Pan
Date: 2024-12-05T20:26:02-08:00
New Revision: fb2cbc00e0b27bc25afd8c831151333a41820bc0
URL:
https://github.com/llvm/llvm-project/commit/fb2cbc00e0b27bc25afd8c831151333a41820bc0
DIFF:
https://github.com/llvm/llvm-project/commit/fb2cbc00e0b27bc25afd8c831151333a41820bc0.diff
LOG:
Author: Owen Pan
Date: 2024-12-09T00:56:24-08:00
New Revision: 411df3bb4941318a02a59b4cd7a898d4f9b788a3
URL:
https://github.com/llvm/llvm-project/commit/411df3bb4941318a02a59b4cd7a898d4f9b788a3
DIFF:
https://github.com/llvm/llvm-project/commit/411df3bb4941318a02a59b4cd7a898d4f9b788a3.diff
LOG:
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/117472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
@@ -361,9 +361,19 @@ class LineJoiner {
const auto *FirstNonComment = TheLine->getFirstNonComment();
if (!FirstNonComment)
return 0;
+
// FIXME: There are probably cases where we should use FirstNonComment
// instead of TheLine->First.
+if (TheLine
https://github.com/owenca approved this pull request.
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
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
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
@@ -3246,8 +3246,15 @@ tooling::Replacements sortCppIncludes(const FormatStyle
&Style, StringRef Code,
SmallVector RawStringMatches;
std::string RawStringTermination = ")\"";
- for (;;) {
-auto Pos = Code.find('\n', SearchFrom);
+ for (const auto Size = Code.size();
owenca wrote:
> A nice multiline example I stumbled upon is:
>
> ```c++
> Tree tree[]
> {
> {'D', tree + 1, tree + 2},
> //│
> //┌───┴┐
> //│
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
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
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
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
@@ -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/", "
@@ -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/", "
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
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
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
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
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
>
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
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
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
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
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:
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
https://github.com/owenca edited
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
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
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
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
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
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
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
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
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
@@ -28314,6 +28320,116 @@ TEST_F(FormatTest, KeepFormFeed) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+ BaseStyle
@@ -28314,6 +28320,116 @@ TEST_F(FormatTest, KeepFormFeed) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+ BaseStyle
@@ -28314,6 +28320,116 @@ TEST_F(FormatTest, KeepFormFeed) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+ BaseStyle
@@ -28314,6 +28320,116 @@ TEST_F(FormatTest, KeepFormFeed) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+ BaseStyle
@@ -616,6 +626,71 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
https://github.com/owenca commented:
Final NFC cleanup.
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
@@ -28314,6 +28320,116 @@ TEST_F(FormatTest, KeepFormFeed) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ auto BaseStyle = getLLVMStyle();
+ BaseStyle.AllowShortNamespacesOnASingleLine = true;
+ BaseStyle.FixNamespaceComments = false;
+ BaseStyle
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/105597
>From 93eb3d89652607173f4f68fce7dcc5b2bd33f266 Mon Sep 17 00:00:00 2001
From: Galen Elias
Date: Wed, 21 Aug 2024 16:33:42 -0700
Subject: [PATCH 01/17] clang-format: Add "AllowShortNamespacesOnASingleLine"
option
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/105597
>From 93eb3d89652607173f4f68fce7dcc5b2bd33f266 Mon Sep 17 00:00:00 2001
From: Galen Elias
Date: Wed, 21 Aug 2024 16:33:42 -0700
Subject: [PATCH 01/18] clang-format: Add "AllowShortNamespacesOnASingleLine"
option
https://github.com/owenca edited
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
https://github.com/owenca closed
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
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
https://github.com/owenca commented:
Also, additional cleanup of `tryMergeNamespace()`:
```cpp
if (Limit == 0)
return 0;
-if (I[1]->InPPDirective != (*I)->InPPDirective ||
-(I[1]->InPPDirective && I[1]->First->HasUnescapedNewline)) {
+
+assert(I[1]);
+const auto &L
@@ -4504,6 +4504,16 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
"} // namespace bb\n"
"} // namespace aa",
Style);
+
+ verifyFormat("namespace a { namespace b { namespace c {\n"
+ "}}} // namespace a::b::
@@ -4484,7 +4484,7 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
"} // namespace A",
Style);
- Style.ColumnLimit = 40;
+ Style.ColumnLimit = 41;
owenca wrote:
```suggestion
Style.ColumnLimit = 40;
```
See below.
https://
@@ -916,6 +983,21 @@ class LineJoiner {
return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
}
+ bool nextNLinesFitInto(SmallVectorImpl::const_iterator I,
+ SmallVectorImpl::const_iterator E,
+ unsign
@@ -4504,6 +4504,16 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
"} // namespace bb\n"
"} // namespace aa",
Style);
+
+ verifyFormat("namespace a { namespace b { namespace c {\n"
+ "}}} // namespace a::b::
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
@@ -616,6 +627,63 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
https://github.com/owenca commented:
Please rebase and run `ninja clang-format-style`.
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
@@ -988,6 +988,10 @@ struct FormatStyle {
/// \version 3.7
bool AllowShortLoopsOnASingleLine;
+ /// If ``true``, ``namespace a { class b; }`` can be put on a single line.
+ /// \version 20
+ bool AllowShortNamespacesOnASingleLine;
owenca wrote:
You nee
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
@@ -28104,6 +28104,138 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.WrapNamespaceBodyWithEmptyLines = FormatSt
@@ -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
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/125327
>From af3d964d74634f0dd9f7216572c1d852b7a549dc Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 31 Jan 2025 18:32:33 -0800
Subject: [PATCH 1/3] [clang-format] Hanlde qualified type names
Fixes #125178.
---
cl
@@ -412,6 +414,15 @@ const FormatToken
*LeftRightQualifierAlignmentFixer::analyzeLeft(
// The case `const long long volatile int` -> `const volatile long long int`
// The case `long volatile long int const` -> `const volatile long long int`
if (TypeToken->isTypeName(Lang
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/125327
>From af3d964d74634f0dd9f7216572c1d852b7a549dc Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 31 Jan 2025 18:32:33 -0800
Subject: [PATCH 1/2] [clang-format] Hanlde qualified type names
Fixes #125178.
---
cl
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/125038
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/124891
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -349,6 +349,13 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
}
}
+ // Allow breaking before the right parens with block indentation if there was
+ // a break after the left parens, which is tracked by BreakBeforeClosingParen
owen
1801 - 1900 of 2694 matches
Mail list logo