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
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
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
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
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
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
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
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
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW
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
@@ -28427,6 +28427,136 @@ TEST_F(FormatTest, ShortNamespacesOption) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.WrapNamespaceBodyWithEmptyLines = FormatStyle::WNBW
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
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
@@ -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/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
-
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
@@ -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
@@ -28104,6 +28104,138 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.WrapNamespaceBodyWithEmptyLines = FormatSt
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
-
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
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
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
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
@@ -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
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+
+ // Empty namespace.
+ verifyFormat("namespace
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+
+ // Empty namespace.
+ verifyFormat("namespace
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+
+ // Empty namespace.
+ verifyFormat("namespace
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+
+ // Empty namespace.
+ verifyFormat("namespace
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
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine *Line,
+ const AnnotatedLine *PreviousLine,
+
@@ -28104,6 +28104,242 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ auto Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+
owenca wrote:
```suggestion
S
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
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
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
-
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
owenca wrote:
```suggestion
auto Style = getLLVMStyle();
```
h
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,253 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
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
-
dmasloff wrote:
> Running `FormatTests` failed:
>
> ```
> [ RUN ] FormatTest.WrapNamespaceBodyWithEmptyLinesNever
> Assertion failed: (TheLine->MatchingClosingBlockLineIndex > 0), function
> tryFitMultipleLinesInOne, file UnwrappedLineFormatter.cpp, line 390.
> ```
@owenca I looked throug
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
@@ -28104,6 +28104,211 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
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
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine *Line,
+ const AnnotatedLine *PreviousLine,
+
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
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
-
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine *Line,
+ const AnnotatedLine *PreviousLine,
+
@@ -6652,6 +6652,48 @@ the configuration (without a prefix: ``Auto``).
For example: BOOST_PP_STRINGIZE
+.. _WrapNamespaceBodyWithEmptyLines:
+
+**WrapNamespaceBodyWithEmptyLines** (``WrapNamespaceBodyWithEmptyLinesStyle``)
:versionbadge:`clang-format 19` :ref:`¶ `
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine *Line,
+ const AnnotatedLine *PreviousLine,
+
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
@@ -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 {
+
@@ -6652,6 +6652,48 @@ the configuration (without a prefix: ``Auto``).
For example: BOOST_PP_STRINGIZE
+.. _WrapNamespaceBodyWithEmptyLines:
+
+**WrapNamespaceBodyWithEmptyLines** (``WrapNamespaceBodyWithEmptyLinesStyle``)
:versionbadge:`clang-format 19` :ref:`¶ `
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -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
@@ -32,6 +32,26 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine *Line,
+ const AnnotatedLine *PreviousLine,
+
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
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
-
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
-
@@ -28104,6 +28104,211 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
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
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
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
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
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
@@ -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)) {
@@ -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
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
@@ -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)) {
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
@@ -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
@@ -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)) {
@@ -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
@@ -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
@@ -32,6 +32,24 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine* Line,
+ const AnnotatedLine* PreviousLine,
+
@@ -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
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
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
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]
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
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
93 matches
Mail list logo