[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-05 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 1/4] clang-format: Add "AllowShortNamespacesOnASingleLine" opti

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-09 Thread Galen Elias via cfe-commits
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + FormatStyle Style = getLLVMStyle(); + Style.AllowShortNamespacesOnASingleLine = true; + Style.FixNamespaceComments = false; + + //

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-09 Thread Galen Elias via cfe-commits
https://github.com/galenelias deleted 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

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-28 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 1/3] clang-format: Add "AllowShortNamespacesOnASingleLine" opti

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-21 Thread Galen Elias via cfe-commits
https://github.com/galenelias created https://github.com/llvm/llvm-project/pull/105597 This addresses: https://github.com/llvm/llvm-project/issues/101363 which is a resurrection of a previously opened but never completed review: https://reviews.llvm.org/D11851 The feature is to allow code lik

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-21 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 3819c15c8c6258d1d29a38fcfb71db8567fb34e5 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 15:46:35 -0700 Subject: [PATCH] clang-format: Add "AllowShortNamespacesOnASingleLine" option T

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-21 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH] clang-format: Add "AllowShortNamespacesOnASingleLine" option T

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-08-22 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 1/2] clang-format: Add "AllowShortNamespacesOnASingleLine" opti

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-08 Thread Galen Elias via cfe-commits
galenelias wrote: Ping 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

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-22 Thread Galen Elias via cfe-commits
galenelias wrote: > I don't think we want to add any tests whose formats are questionable or > still under discussion. WDYT @mydeveloperday @HazardyKnusperkeks @rymiel ? Ok, that's fair. I have removed these tests. Thanks for the detailed response and context. https://github.com/llvm/llvm-p

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-22 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 01/11] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-11-08 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 01/12] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-11-12 Thread Galen Elias via cfe-commits
galenelias wrote: Ping 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

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) g

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
@@ -616,6 +626,62 @@ class LineJoiner { return 1; } + unsigned tryMergeNamespace(SmallVectorImpl::const_iterator I, + SmallVectorImpl::const_iterator E, + unsigned Limit) { +if (Limit == 0) + return 0; +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + auto BaseStyle = getLLVMStyle(); + BaseStyle.AllowShortNamespacesOnASingleLine = true; + BaseStyle.FixNamespaceComments = false; + +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 1/8] clang-format: Add "AllowShortNamespacesOnASingleLine" opti

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-25 Thread Galen Elias via cfe-commits
@@ -27981,6 +27981,132 @@ TEST_F(FormatTest, BreakBinaryOperations) { Style); } +TEST_F(FormatTest, ShortNamespacesOption) { + auto BaseStyle = getLLVMStyle(); + BaseStyle.AllowShortNamespacesOnASingleLine = true; + BaseStyle.FixNamespaceComments = false; + +

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-09-26 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 1/9] clang-format: Add "AllowShortNamespacesOnASingleLine" opti

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-15 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/105597 >From 4118b7dde9adbee7b6aaf5d094d34cb6b64f6c77 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 21 Aug 2024 16:33:42 -0700 Subject: [PATCH 01/10] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] clang-format: Add "AllowShortNamespacesOnASingleLine" option (PR #105597)

2024-10-15 Thread Galen Elias via cfe-commits
galenelias wrote: > I'm inclined to think that all the AllowShort options should work the same > way whether ColumnLimit is 0. However, a couple of them I checked > (AllowShortLoops and AllowShortBlocks) have no effect unless set to false. I > suggest that we mark the test as a FIXME or don't

[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-29 Thread Galen Elias via cfe-commits
@@ -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::

[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-28 Thread Galen Elias via cfe-commits
https://github.com/galenelias 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/15] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-29 Thread Galen Elias via cfe-commits
https://github.com/galenelias 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/16] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-27 Thread Galen Elias via cfe-commits
https://github.com/galenelias 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/14] clang-format: Add "AllowShortNamespacesOnASingleLine" op

[clang] [clang-format] Add `AllowShortNamespacesOnASingleLine` option (PR #105597)

2024-12-27 Thread Galen Elias via 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; +

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-02-11 Thread Galen Elias via cfe-commits
@@ -28430,6 +28430,36 @@ TEST_F(FormatTest, ShortNamespacesOption) { "}}} // namespace foo::bar::baz", "namespace foo { namespace bar { namespace baz { class qux; } } }", Style); + Style.FixNamespaceComments = false; + + Style.BreakBeforeBraces = FormatStyle

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-22 Thread Galen Elias via cfe-commits
galenelias wrote: > Is there an github "Issue" for this? I can't quite understand what problem we > are trying to fix. There is not a GitHub Issue filed yet, but I could get one filed if that would be helpful. The issue is just there are users who want to use `AllowShortNamespacesOnASingleLi

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-21 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/123010 >From 9d60d4980f1edbdd4cd4a9499f69e9d225717238 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Tue, 14 Jan 2025 20:44:10 -0800 Subject: [PATCH 1/2] Support BraceWrapping.AfterNamespace with AllowShortNamesp

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-27 Thread Galen Elias via cfe-commits
@@ -628,28 +632,36 @@ class LineJoiner { unsigned tryMergeNamespace(ArrayRef::const_iterator I, ArrayRef::const_iterator E, - unsigned Limit) { + unsigned Limit, bool OpenBraceWrapped) {

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-27 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/123010 >From 9d60d4980f1edbdd4cd4a9499f69e9d225717238 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Tue, 14 Jan 2025 20:44:10 -0800 Subject: [PATCH 1/3] Support BraceWrapping.AfterNamespace with AllowShortNamesp

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-01-14 Thread Galen Elias via cfe-commits
https://github.com/galenelias created https://github.com/llvm/llvm-project/pull/123010 AllowShortNamespacesOnASingleLine assumes that there is no newline before the namespace brace, however, there is no actual reason this shouldn't be compatible with BraceWrapping.AfterNamespace = true. This

[clang] [clang-format] Support BraceWrapping.AfterNamespace with AllowShortNamespacesOnASingleLine (PR #123010)

2025-02-13 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/123010 >From 9d60d4980f1edbdd4cd4a9499f69e9d225717238 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Tue, 14 Jan 2025 20:44:10 -0800 Subject: [PATCH 1/5] Support BraceWrapping.AfterNamespace with AllowShortNamesp

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-17 Thread Galen Elias via cfe-commits
https://github.com/galenelias created https://github.com/llvm/llvm-project/pull/136167 This addresses: Issue #77341: clang-tidy fails to parse config files silently, even with --verify-config. Currently when clang-tidy attempts to parse a .clang-tidy config file with invalid syntax, it emits

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-30 Thread Galen Elias via cfe-commits
@@ -337,8 +337,7 @@ Allow empty enabled checks. This suppresses the "no checks enabled" error when disabling all of the checks. )"), - cl::init(false), - cl::cat(ClangTidyCategory)); +

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-04-30 Thread Galen Elias via cfe-commits
@@ -46,20 +46,20 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) { FileOptionsProvider FileOpt({}, {}, {}, FileSystem); - ClangTidyOptions File1Options = + llvm::ErrorOr File1Options = FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp"); - ClangTidyOptions F

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-01 Thread Galen Elias via cfe-commits
@@ -266,7 +266,7 @@ ClangTidyOptions ClangTidyContext::getOptionsForFile(StringRef File) const { // Merge options on top of getDefaults() as a safeguard against options with // unset values. return ClangTidyOptions::getDefaults().merge( - OptionsProvider->getOptions

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-01 Thread Galen Elias via cfe-commits
@@ -266,7 +266,7 @@ ClangTidyOptions ClangTidyContext::getOptionsForFile(StringRef File) const { // Merge options on top of getDefaults() as a safeguard against options with // unset values. return ClangTidyOptions::getDefaults().merge( - OptionsProvider->getOptions

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-01 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/136167 >From f54d980bafd76863ab63e68f0568dcfc3329fd9f Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 16 Apr 2025 12:48:18 -0700 Subject: [PATCH 1/6] [clang-tidy] Return error code on config parse error This

[clang-tools-extra] [clang-tidy] Return error code on config parse error (PR #136167)

2025-05-01 Thread Galen Elias via cfe-commits
https://github.com/galenelias updated https://github.com/llvm/llvm-project/pull/136167 >From b8faa7bb02fb4aa0504978dad1a28493fc745786 Mon Sep 17 00:00:00 2001 From: Galen Elias Date: Wed, 16 Apr 2025 12:48:18 -0700 Subject: [PATCH 1/6] [clang-tidy] Return error code on config parse error This