[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-25 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-25 Thread Owen Pan via 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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-25 Thread Owen Pan via 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" +"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via 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" +"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Owen Pan via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-24 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Owen Pan via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Owen Pan via 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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Owen Pan via 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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Björn Schäpers via 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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-22 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-21 Thread Owen Pan via 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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-21 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?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" -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via 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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via cfe-commits
=?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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Owen Pan via 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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-20 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-18 Thread Björn Schäpers via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-18 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Owen Pan via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Owen Pan via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Björn Schäpers via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-17 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-16 Thread Owen Pan via cfe-commits
@@ -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);

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-15 Thread Björn Schäpers via 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" +"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-15 Thread Björn Schäpers via cfe-commits
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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-15 Thread Owen Pan via cfe-commits
=?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" -

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-10 Thread Björn Schäpers via 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" +"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-10 Thread Björn Schäpers via cfe-commits
@@ -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"

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-10 Thread Björn Schäpers via cfe-commits
@@ -20794,7 +20794,7 @@ TEST_F(FormatTest, CatchAlignArrayOfStructuresRightAlignment) { verifyFormat("int a[][] = {\n" "{\n" " {0, 2}, //\n" - " {1, 2} //\n" + " {1, 2} //\n" HazardyKnusperke

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-10 Thread via cfe-commits
=?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

[clang] [clang-format] Don't align comments over scopes (PR #68743)

2023-10-10 Thread Björn Schäpers via cfe-commits
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