[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
https://github.com/Sirraide closed https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
https://github.com/mydeveloperday approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
Sirraide wrote: Alright, I think everything should be sorted now https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/123493
>From 6475c9dfc20901c03d4120b745fa6076502510f5 Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Sun, 19 Jan 2025 03:35:09 +0100
Subject: [PATCH 1/2] [clang-format] Rename ExportBlockIndentation ->
IndentExportBlock
---
clang/docs/ClangFormatStyleOptions.rst | 30 +++---
clang/docs/ReleaseNotes.rst| 2 +-
clang/include/clang/Format/Format.h| 4 +--
clang/lib/Format/Format.cpp| 4 +--
clang/lib/Format/UnwrappedLineParser.cpp | 3 +--
clang/unittests/Format/ConfigParseTest.cpp | 1 +
clang/unittests/Format/FormatTest.cpp | 8 +++---
7 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/clang/docs/ClangFormatStyleOptions.rst
b/clang/docs/ClangFormatStyleOptions.rst
index 511a967f66d10a..30a2325949f48a 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3946,21 +3946,6 @@ the configuration (without a prefix: ``Auto``).
This is an experimental flag, that might go away or be renamed. Do
not use this in config files, etc. Use at your own risk.
-.. _ExportBlockIndentation:
-
-**ExportBlockIndentation** (``Boolean``) :versionbadge:`clang-format 20`
:ref:`¶ `
- If ``true``, clang-format will indent the body of an ``export { ... }``
- block. This doesn't affect the formatting of anything else related to
- exported declarations.
-
- .. code-block:: c++
-
- true: false:
- export { vs. export {
- void foo(); void foo();
- void bar(); void bar();
- } }
-
.. _FixNamespaceComments:
**FixNamespaceComments** (``Boolean``) :versionbadge:`clang-format 5` :ref:`¶
`
@@ -4228,6 +4213,21 @@ the configuration (without a prefix: ``Auto``).
plop(); plop();
} }
+.. _IndentExportBlock:
+
+**IndentExportBlock** (``Boolean``) :versionbadge:`clang-format 20` :ref:`¶
`
+ If ``true``, clang-format will indent the body of an ``export { ... }``
+ block. This doesn't affect the formatting of anything else related to
+ exported declarations.
+
+ .. code-block:: c++
+
+ true: false:
+ export { vs. export {
+ void foo(); void foo();
+ void bar(); void bar();
+ } }
+
.. _IndentExternBlock:
**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format
11` :ref:`¶ `
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 14a3b5db05ff3b..8b807916fdc823 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1224,7 +1224,7 @@ clang-format
- Adds ``VariableTemplates`` option.
- Adds support for bash globstar in ``.clang-format-ignore``.
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
-- Adds the ``ExportBlockIndentation`` option.
+- Adds the ``IndentExportBlock`` option.
libclang
diff --git a/clang/include/clang/Format/Format.h
b/clang/include/clang/Format/Format.h
index c31423841ec1ac..e09dacef677186 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2687,7 +2687,7 @@ struct FormatStyle {
///} }
/// \endcode
/// \version 20
- bool ExportBlockIndentation;
+ bool IndentExportBlock;
/// If ``true``, clang-format adds missing namespace end comments for
/// namespaces and fixes invalid existing ones. This doesn't affect short
@@ -5267,7 +5267,7 @@ struct FormatStyle {
EmptyLineBeforeAccessModifier == R.EmptyLineBeforeAccessModifier &&
ExperimentalAutoDetectBinPacking ==
R.ExperimentalAutoDetectBinPacking &&
- ExportBlockIndentation == R.ExportBlockIndentation &&
+ IndentExportBlock == R.IndentExportBlock &&
FixNamespaceComments == R.FixNamespaceComments &&
ForEachMacros == R.ForEachMacros &&
IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 6826fa76662cfb..8184cf29941885 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1040,7 +1040,7 @@ template <> struct MappingTraits {
Style.EmptyLineBeforeAccessModifier);
IO.mapOptional("ExperimentalAutoDetectBinPacking",
Style.ExperimentalAutoDetectBinPacking);
-IO.mapOptional("ExportBlockIndentation", Style.ExportBlockIndentation);
+IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments);
IO.mapOptional("ForEachMacros", Style.ForEachMacros);
IO.mapOptional("IfMacros", Style.IfMacros);
@@ -1551,7 +1551,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Langu
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
HazardyKnusperkeks wrote: > I assume ExportBlockIndentation is not out in the wild too much so no need to > backwards support, was ExportBlockIndentation added this release? No it does not. It was just added. https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
mydeveloperday wrote: fix up the alphabetically bits and this looks good. https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
mydeveloperday wrote: I assume ExportBlockIndentation is not out in the wild too much so no need to backwards support, was ExportBlockIndentation added this release? https://github.com/llvm/llvm-project/pull/123493 ___ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
@@ -5267,7 +5267,7 @@ struct FormatStyle {
EmptyLineBeforeAccessModifier == R.EmptyLineBeforeAccessModifier &&
ExperimentalAutoDetectBinPacking ==
R.ExperimentalAutoDetectBinPacking &&
- ExportBlockIndentation == R.ExportBlockIndentation &&
+ IndentExportBlock == R.IndentExportBlock &&
owenca wrote:
ditto
https://github.com/llvm/llvm-project/pull/123493
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
@@ -1551,7 +1551,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
LLVMStyle.EmptyLineAfterAccessModifier = FormatStyle::ELAAMS_Never;
LLVMStyle.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_LogicalBlock;
LLVMStyle.ExperimentalAutoDetectBinPacking = false;
- LLVMStyle.ExportBlockIndentation = true;
+ LLVMStyle.IndentExportBlock = true;
owenca wrote:
ditto
https://github.com/llvm/llvm-project/pull/123493
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
@@ -1040,7 +1040,7 @@ template <> struct MappingTraits {
Style.EmptyLineBeforeAccessModifier);
IO.mapOptional("ExperimentalAutoDetectBinPacking",
Style.ExperimentalAutoDetectBinPacking);
-IO.mapOptional("ExportBlockIndentation", Style.ExportBlockIndentation);
+IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
owenca wrote:
ditto
https://github.com/llvm/llvm-project/pull/123493
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
@@ -2687,7 +2687,7 @@ struct FormatStyle {
///} }
/// \endcode
/// \version 20
- bool ExportBlockIndentation;
+ bool IndentExportBlock;
owenca wrote:
Please keep the options sorted by moving it down to right after
`IndentCaseLabels`.
https://github.com/llvm/llvm-project/pull/123493
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: None (Sirraide)
Changes
This renames the `ExportBlockIndentation` option and adds a config parse test,
as requested in #110381.
---
Full diff: https://github.com/llvm/llvm-project/pull/123493.diff
7 Files Affected:
- (modified) clang/docs/ClangFormatStyleOptions.rst (+15-15)
- (modified) clang/docs/ReleaseNotes.rst (+1-1)
- (modified) clang/include/clang/Format/Format.h (+2-2)
- (modified) clang/lib/Format/Format.cpp (+2-2)
- (modified) clang/lib/Format/UnwrappedLineParser.cpp (+1-2)
- (modified) clang/unittests/Format/ConfigParseTest.cpp (+1)
- (modified) clang/unittests/Format/FormatTest.cpp (+4-4)
``diff
diff --git a/clang/docs/ClangFormatStyleOptions.rst
b/clang/docs/ClangFormatStyleOptions.rst
index 511a967f66d10a..30a2325949f48a 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3946,21 +3946,6 @@ the configuration (without a prefix: ``Auto``).
This is an experimental flag, that might go away or be renamed. Do
not use this in config files, etc. Use at your own risk.
-.. _ExportBlockIndentation:
-
-**ExportBlockIndentation** (``Boolean``) :versionbadge:`clang-format 20`
:ref:`¶ `
- If ``true``, clang-format will indent the body of an ``export { ... }``
- block. This doesn't affect the formatting of anything else related to
- exported declarations.
-
- .. code-block:: c++
-
- true: false:
- export { vs. export {
- void foo(); void foo();
- void bar(); void bar();
- } }
-
.. _FixNamespaceComments:
**FixNamespaceComments** (``Boolean``) :versionbadge:`clang-format 5` :ref:`¶
`
@@ -4228,6 +4213,21 @@ the configuration (without a prefix: ``Auto``).
plop(); plop();
} }
+.. _IndentExportBlock:
+
+**IndentExportBlock** (``Boolean``) :versionbadge:`clang-format 20` :ref:`¶
`
+ If ``true``, clang-format will indent the body of an ``export { ... }``
+ block. This doesn't affect the formatting of anything else related to
+ exported declarations.
+
+ .. code-block:: c++
+
+ true: false:
+ export { vs. export {
+ void foo(); void foo();
+ void bar(); void bar();
+ } }
+
.. _IndentExternBlock:
**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format
11` :ref:`¶ `
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 14a3b5db05ff3b..8b807916fdc823 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1224,7 +1224,7 @@ clang-format
- Adds ``VariableTemplates`` option.
- Adds support for bash globstar in ``.clang-format-ignore``.
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
-- Adds the ``ExportBlockIndentation`` option.
+- Adds the ``IndentExportBlock`` option.
libclang
diff --git a/clang/include/clang/Format/Format.h
b/clang/include/clang/Format/Format.h
index c31423841ec1ac..e09dacef677186 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2687,7 +2687,7 @@ struct FormatStyle {
///} }
/// \endcode
/// \version 20
- bool ExportBlockIndentation;
+ bool IndentExportBlock;
/// If ``true``, clang-format adds missing namespace end comments for
/// namespaces and fixes invalid existing ones. This doesn't affect short
@@ -5267,7 +5267,7 @@ struct FormatStyle {
EmptyLineBeforeAccessModifier == R.EmptyLineBeforeAccessModifier &&
ExperimentalAutoDetectBinPacking ==
R.ExperimentalAutoDetectBinPacking &&
- ExportBlockIndentation == R.ExportBlockIndentation &&
+ IndentExportBlock == R.IndentExportBlock &&
FixNamespaceComments == R.FixNamespaceComments &&
ForEachMacros == R.ForEachMacros &&
IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 6826fa76662cfb..8184cf29941885 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1040,7 +1040,7 @@ template <> struct MappingTraits {
Style.EmptyLineBeforeAccessModifier);
IO.mapOptional("ExperimentalAutoDetectBinPacking",
Style.ExperimentalAutoDetectBinPacking);
-IO.mapOptional("ExportBlockIndentation", Style.ExportBlockIndentation);
+IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments);
IO.mapOptional("ForEachMacros", Style.ForEachMacros);
IO.mapOptional("IfMacros", Style.IfMacros);
@@ -1551,7 +1551,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
LLVMStyle.EmptyLineAfterAccessModifie
[clang] [clang-format] Rename ExportBlockIndentation -> IndentExportBlock (PR #123493)
https://github.com/Sirraide created
https://github.com/llvm/llvm-project/pull/123493
This renames the `ExportBlockIndentation` option and adds a config parse test,
as requested in #110381.
>From 6475c9dfc20901c03d4120b745fa6076502510f5 Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Sun, 19 Jan 2025 03:35:09 +0100
Subject: [PATCH] [clang-format] Rename ExportBlockIndentation ->
IndentExportBlock
---
clang/docs/ClangFormatStyleOptions.rst | 30 +++---
clang/docs/ReleaseNotes.rst| 2 +-
clang/include/clang/Format/Format.h| 4 +--
clang/lib/Format/Format.cpp| 4 +--
clang/lib/Format/UnwrappedLineParser.cpp | 3 +--
clang/unittests/Format/ConfigParseTest.cpp | 1 +
clang/unittests/Format/FormatTest.cpp | 8 +++---
7 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/clang/docs/ClangFormatStyleOptions.rst
b/clang/docs/ClangFormatStyleOptions.rst
index 511a967f66d10ac..30a2325949f48ac 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -3946,21 +3946,6 @@ the configuration (without a prefix: ``Auto``).
This is an experimental flag, that might go away or be renamed. Do
not use this in config files, etc. Use at your own risk.
-.. _ExportBlockIndentation:
-
-**ExportBlockIndentation** (``Boolean``) :versionbadge:`clang-format 20`
:ref:`¶ `
- If ``true``, clang-format will indent the body of an ``export { ... }``
- block. This doesn't affect the formatting of anything else related to
- exported declarations.
-
- .. code-block:: c++
-
- true: false:
- export { vs. export {
- void foo(); void foo();
- void bar(); void bar();
- } }
-
.. _FixNamespaceComments:
**FixNamespaceComments** (``Boolean``) :versionbadge:`clang-format 5` :ref:`¶
`
@@ -4228,6 +4213,21 @@ the configuration (without a prefix: ``Auto``).
plop(); plop();
} }
+.. _IndentExportBlock:
+
+**IndentExportBlock** (``Boolean``) :versionbadge:`clang-format 20` :ref:`¶
`
+ If ``true``, clang-format will indent the body of an ``export { ... }``
+ block. This doesn't affect the formatting of anything else related to
+ exported declarations.
+
+ .. code-block:: c++
+
+ true: false:
+ export { vs. export {
+ void foo(); void foo();
+ void bar(); void bar();
+ } }
+
.. _IndentExternBlock:
**IndentExternBlock** (``IndentExternBlockStyle``) :versionbadge:`clang-format
11` :ref:`¶ `
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 14a3b5db05ff3b7..8b807916fdc8237 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -1224,7 +1224,7 @@ clang-format
- Adds ``VariableTemplates`` option.
- Adds support for bash globstar in ``.clang-format-ignore``.
- Adds ``WrapNamespaceBodyWithEmptyLines`` option.
-- Adds the ``ExportBlockIndentation`` option.
+- Adds the ``IndentExportBlock`` option.
libclang
diff --git a/clang/include/clang/Format/Format.h
b/clang/include/clang/Format/Format.h
index c31423841ec1ac2..e09dacef6771861 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -2687,7 +2687,7 @@ struct FormatStyle {
///} }
/// \endcode
/// \version 20
- bool ExportBlockIndentation;
+ bool IndentExportBlock;
/// If ``true``, clang-format adds missing namespace end comments for
/// namespaces and fixes invalid existing ones. This doesn't affect short
@@ -5267,7 +5267,7 @@ struct FormatStyle {
EmptyLineBeforeAccessModifier == R.EmptyLineBeforeAccessModifier &&
ExperimentalAutoDetectBinPacking ==
R.ExperimentalAutoDetectBinPacking &&
- ExportBlockIndentation == R.ExportBlockIndentation &&
+ IndentExportBlock == R.IndentExportBlock &&
FixNamespaceComments == R.FixNamespaceComments &&
ForEachMacros == R.ForEachMacros &&
IncludeStyle.IncludeBlocks == R.IncludeStyle.IncludeBlocks &&
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 6826fa76662cfbe..8184cf29941885a 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1040,7 +1040,7 @@ template <> struct MappingTraits {
Style.EmptyLineBeforeAccessModifier);
IO.mapOptional("ExperimentalAutoDetectBinPacking",
Style.ExperimentalAutoDetectBinPacking);
-IO.mapOptional("ExportBlockIndentation", Style.ExportBlockIndentation);
+IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments);
IO.mapOptional("ForEachMacros", Style.ForEachMacros);
IO.mapOptiona
