https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/68743
___
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/68743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
"int a; // This is unrelated"));
EXPECT_EQ("class C {\n"
" void f() { // This does something ..\n"
-" } // awesome..\n"
+"
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
"int a; // This is unrelated"));
EXPECT_EQ("class C {\n"
" void f() { // This does something ..\n"
-" } // awesome..\n"
+"
@@ -3191,20 +3198,167 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -3191,20 +3198,167 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 3e76e5a0724af4d6f24175796856c919f30547a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
@@ -3191,20 +3198,167 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -3191,20 +3198,150 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 465003388953a52b70702d45cef7c4031581310d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
@@ -3191,20 +3198,150 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -1118,16 +1121,48 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/68743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1118,16 +1121,48 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 2efda4c7d5e99b3506a874d514adcb16fe46adce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
@@ -1118,16 +1121,48 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 8df1b77e223cd5ab5d759ae2d57f4c79306f9149 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?=
Message-ID:
In-Reply-To:
@@ -3102,7 +3102,9 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments) {
StringRef Input = "namespace A {\n"
" TESTSUITE(B) {\n"
"namespace C {\n"
-
=?utf-8?q?Björn_Schäpers?=
Message-ID:
In-Reply-To:
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/68743
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?=
Message-ID:
In-Reply-To:
@@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBe
=?utf-8?q?Björn_Schäpers?=
Message-ID:
In-Reply-To:
@@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0
=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?=
Message-ID:
In-Reply-To:
@@ -1118,16 +1121,39 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBe
HazardyKnusperkeks wrote:
Some pathological test cases added and handling do-while (relying on #69707).
Only a reply from @mydeveloperday open regarding the change of the existing
test with function braces.
https://github.com/llvm/llvm-project/pull/68743
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From be24095877e6ddd25e0884ad8aaf3eca4846f38d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Fri, 20 Oct 2023 13:00:39 +0200
Subject: [PATCH 1/2] [clang-format] Annotate do
@@ -1118,16 +1121,35 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -3191,20 +3191,146 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -1118,16 +1121,35 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -3191,20 +3191,146 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 84ebaa789588605c924708a98392bd014c63f373 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
@@ -3191,20 +3191,120 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From 33de4ec9a01a138203d0e703c8a313bb534d6e31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
@@ -3191,20 +3191,120 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -20794,7 +20794,7 @@ TEST_F(FormatTest,
CatchAlignArrayOfStructuresRightAlignment) {
verifyFormat("int a[][] = {\n"
"{\n"
" {0, 2}, //\n"
- " {1, 2} //\n"
+ " {1, 2} //\n"
owenca wrote:
W
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -1118,16 +1121,40 @@ void WhitespaceManager::alignTrailingComments() {
}
}
-// We don't want to align namespace end comments.
-const bool DontAlignThisComment =
-I > 0 && C.NewlinesBefore == 0 &&
-Changes[I - 1].Tok->is(TT_NamespaceRBrace);
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
"int a; // This is unrelated"));
EXPECT_EQ("class C {\n"
" void f() { // This does something ..\n"
-" } // awesome..\n"
+"
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/68743
From be37afa11c861b96b88adf99e2366b04b216b459 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Tue, 10 Oct 2023 22:50:43 +0200
Subject: [PATCH] [clang-format] Don't align com
=?utf-8?q?Björn_Schäpers?=
Message-ID:
In-Reply-To:
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
"int a; // This is unrelated"));
EXPECT_EQ("class C {\n"
" void f() { // This does something ..\n"
-
@@ -182,7 +182,7 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) {
"int a; // This is unrelated"));
EXPECT_EQ("class C {\n"
" void f() { // This does something ..\n"
-" } // awesome..\n"
+"
@@ -3191,20 +3191,120 @@ TEST_F(FormatTestComments, DontAlignNamespaceComments)
{
"}\n"
"// Comment";
-#if 0
- // FIXME: The following comment is aligned with the namespace comment.
verifyFormat("namespace A {\n"
" int Foo;\n"
@@ -20794,7 +20794,7 @@ TEST_F(FormatTest,
CatchAlignArrayOfStructuresRightAlignment) {
verifyFormat("int a[][] = {\n"
"{\n"
" {0, 2}, //\n"
- " {1, 2} //\n"
+ " {1, 2} //\n"
HazardyKnusperke
=?utf-8?q?Björn_Schäpers?=
Message-ID:
In-Reply-To:
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: Björn Schäpers (HazardyKnusperkeks)
Changes
We now stop aligning trailing comments on all closing braces, for
classes etc. we even check for the semicolon between the comment and
https://github.com/HazardyKnusperkeks created
https://github.com/llvm/llvm-project/pull/68743
We now stop aligning trailing comments on all closing braces, for
classes etc. we even check for the semicolon between the comment and the
brace.
Fixes #67906.
From 358cbf4fd25d2d323e21774a3d4f5a6
46 matches
Mail list logo