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

2025-01-02 Thread via cfe-commits
github-actions[bot] wrote: @dmasloff Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build

[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 new option: WrapNamespaceBodyWithNewlines (PR #106145)

2025-01-02 Thread via cfe-commits
https://github.com/dmasloff 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 1/9] fix merge conflict --- clang/docs/ClangFormatStyleOptions.rst

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

2025-01-02 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 9848394edfa4bbae9f4f2df4b3dbcecefeb72624 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/9] 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 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] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-12-31 Thread via cfe-commits
dmasloff wrote: Resolved merge conflict 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-12-31 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 9848394edfa4bbae9f4f2df4b3dbcecefeb72624 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/8] fix merge conflict --- clang/docs/ClangFormatStyleOptions.rst

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

2024-12-31 Thread 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-31 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/7] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

[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

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

2024-11-16 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/6] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

[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] 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] 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] 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] 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
@@ -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; + + // Empty namespace. + verifyFormat("namespace

[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; + owenca wrote: ```suggestion S

[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] Add new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-10-10 Thread via cfe-commits
dmasloff wrote: @owenca @mydeveloperday @HazardyKnusperkeks could somebody continue the review? 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

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

2024-09-25 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/5] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); owenca wrote: ```suggestion auto Style = getLLVMStyle(); ``` h

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-22 Thread Owen Pan via cfe-commits
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-17 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/4] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

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

2024-09-17 Thread via cfe-commits
dmasloff wrote: > Running `FormatTests` failed: > > ``` > [ RUN ] FormatTest.WrapNamespaceBodyWithEmptyLinesNever > Assertion failed: (TheLine->MatchingClosingBlockLineIndex > 0), function > tryFitMultipleLinesInOne, file UnwrappedLineFormatter.cpp, line 390. > ``` @owenca I looked throug

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

2024-09-08 Thread Owen Pan via cfe-commits
https://github.com/owenca requested changes to this pull request. Running `FormatTests` failed: ``` [ RUN ] FormatTest.WrapNamespaceBodyWithEmptyLinesNever Assertion failed: (TheLine->MatchingClosingBlockLineIndex > 0), function tryFitMultipleLinesInOne, file UnwrappedLineFormatter.cpp, lin

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

2024-09-05 Thread via cfe-commits
@@ -28104,6 +28104,211 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-05 Thread Björn Schäpers via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-05 Thread via cfe-commits
https://github.com/dmasloff 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)

2024-09-05 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-05 Thread 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-09-05 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-03 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/3] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

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

2024-09-03 Thread 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-09-03 Thread via cfe-commits
@@ -6652,6 +6652,48 @@ the configuration (without a prefix: ``Auto``). For example: BOOST_PP_STRINGIZE +.. _WrapNamespaceBodyWithEmptyLines: + +**WrapNamespaceBodyWithEmptyLines** (``WrapNamespaceBodyWithEmptyLinesStyle``) :versionbadge:`clang-format 19` :ref:`¶ `

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

2024-09-03 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-03 Thread 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-09-03 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to 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 new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-03 Thread via cfe-commits
@@ -5057,6 +5057,43 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Different styles for modify number of empty lines in + /// the beginning and at the of end of namespaces. + enum WrapNamespaceBodyWithEmptyLinesStyle : int8_t { +

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

2024-09-03 Thread via cfe-commits
@@ -6652,6 +6652,48 @@ the configuration (without a prefix: ``Auto``). For example: BOOST_PP_STRINGIZE +.. _WrapNamespaceBodyWithEmptyLines: + +**WrapNamespaceBodyWithEmptyLines** (``WrapNamespaceBodyWithEmptyLinesStyle``) :versionbadge:`clang-format 19` :ref:`¶ `

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

2024-09-03 Thread via cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-03 Thread via cfe-commits
@@ -829,6 +829,18 @@ template <> struct ScalarEnumerationTraits { } }; +template <> mydeveloperday wrote: should there be some config parse tests https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits

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

2024-09-03 Thread 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-09-03 Thread via cfe-commits
https://github.com/mydeveloperday requested changes to 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 new option: WrapNamespaceBodyWithNewlines (PR #106145)

2024-09-02 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/2] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

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

2024-09-02 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH 1/2] [clang-format] Add new option: WrapNamespaceBodyWithNewlines -

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

2024-09-02 Thread Björn Schäpers via cfe-commits
@@ -28104,6 +28104,211 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) { + FormatStyle Style = getLLVMStyle(); + Style.FixNamespaceComments = false; + Style.ShortNamespaceLines = 0; + Style.M

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

2024-09-01 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH] [clang-format] Add new option: WrapNamespaceBodyWithNewlines --- c

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

2024-09-01 Thread via cfe-commits
dmasloff wrote: > Please run `git clang-format HEAD~` and `ninja clang-format-check-format` > before pushing. Maybe it's only my problem, but i get this message running `git clang-format HEAD~`, hopefully I could fix it all manually using `ninja clang-format-check-format`: ``` /Users/daniilma

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

2024-09-01 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 219424f9cd3477d9290c8766eaa857234a1ae387 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH] [clang-format] Add new option: WrapNamespaceBodyWithNewlines --- c

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

2024-08-31 Thread Owen Pan via cfe-commits
owenca wrote: Please run `git clang-format HEAD~` and `ninja clang-format-check-format` before pushing. https://github.com/llvm/llvm-project/pull/106145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

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

2024-08-31 Thread via cfe-commits
https://github.com/dmasloff updated https://github.com/llvm/llvm-project/pull/106145 >From 568c99faf02964e278161bf1d8a469229e228758 Mon Sep 17 00:00:00 2001 From: dmasloff Date: Mon, 26 Aug 2024 22:11:05 +0300 Subject: [PATCH] [clang-format] Add new option: WrapNamespaceBodyWithNewlines --- c

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

2024-08-28 Thread Björn Schäpers via cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Insert empty line after "{" that opens namespace scope + if (Style.WrapNamespaceBodyWithNewlines && + LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {

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

2024-08-28 Thread Björn Schäpers via cfe-commits
@@ -5057,6 +5057,21 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Insert a newline at the begging and at the end of namespace definition + /// \code + /// false: vs. true: + /// + /// namespace

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

2024-08-28 Thread via cfe-commits
https://github.com/dmasloff 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)

2024-08-28 Thread via cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Insert empty line after "{" that opens namespace scope + if (Style.WrapNamespaceBodyWithNewlines && + LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {

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

2024-08-28 Thread via cfe-commits
https://github.com/dmasloff 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)

2024-08-28 Thread via cfe-commits
@@ -5057,6 +5057,21 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Insert a newline at the begging and at the end of namespace definition + /// \code + /// false: vs. true: + /// + /// namespace

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

2024-08-27 Thread Björn Schäpers via cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Insert empty line after "{" that opens namespace scope + if (Style.WrapNamespaceBodyWithNewlines && + LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {

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

2024-08-27 Thread Björn Schäpers via cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line, Newlines = 1; } + // Insert empty line after "{" that opens namespace scope HazardyKnusperkeks wrote: ```suggestion // Insert empty line after "{" that opens namespace scop

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

2024-08-27 Thread Björn Schäpers via cfe-commits
@@ -5057,6 +5057,21 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Insert a newline at the begging and at the end of namespace definition + /// \code + /// false: vs. true: + /// + /// namespace

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

2024-08-27 Thread Björn Schäpers via cfe-commits
@@ -32,6 +32,24 @@ 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-08-27 Thread Björn Schäpers via cfe-commits
@@ -5057,6 +5057,21 @@ struct FormatStyle { /// \version 11 std::vector WhitespaceSensitiveMacros; + /// Insert a newline at the begging and at the end of namespace definition HazardyKnusperkeks wrote: ```suggestion /// Insert a newline at the begging

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

2024-08-27 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 2847020dbd9b8f932ee564651ec72ce15fa37d07 84ba9930e4650319265b2fabd2715268a91de614 --e

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

2024-08-27 Thread via cfe-commits
dmasloff wrote: @mydeveloperday sorry for tagging, I hope it could save some time for out team as in this [issue](https://github.com/llvm/llvm-project/issues/102582) you seemed positive about new contributors https://github.com/llvm/llvm-project/pull/106145

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

2024-08-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (dmasloff) Changes I would like to suggest a new clang-format option for llvm-project - WrapNamespaceBodyWithNewlines. I think it can be added to upstream since it is used by many popular public repositories, for example, [ytsaurus]

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

2024-08-26 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

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

2024-08-26 Thread via cfe-commits
https://github.com/dmasloff created https://github.com/llvm/llvm-project/pull/106145 I would like to suggest a new clang-format option for llvm-project - WrapNamespaceBodyWithNewlines. I think it can be added to upstream since it is used by many popular public repositories, for example, [ytsa