[PATCH] D116557: [clang-format] Fix SeparateDefinitionBlocks docs and ...
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 3 14:17:33 PST 2022
HazardyKnusperkeks created this revision.
HazardyKnusperkeks added reviewers: ksyx, MyDeveloperDay, curdeius.
HazardyKnusperkeks added a project: clang-format.
HazardyKnusperkeks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
the Style's equality operator.
This amends 6f6f88ffdae1e12e5f950ef418827a77a55c09c7 <https://reviews.llvm.org/rG6f6f88ffdae1e12e5f950ef418827a77a55c09c7> (D116314 <https://reviews.llvm.org/D116314>)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116557
Files:
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/include/clang/Format/Format.h
Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -3054,6 +3054,7 @@
bool ReflowComments;
// clang-format on
+ /// \brief The style if definition blocks should be separated.
enum SeparateDefinitionStyle {
/// Leave definition blocks as they are.
SDS_Leave,
@@ -3853,6 +3854,7 @@
QualifierOrder == R.QualifierOrder &&
RawStringFormats == R.RawStringFormats &&
ReferenceAlignment == R.ReferenceAlignment &&
+ SeparateDefinitionBlocks == R.SeparateDefinitionBlocks &&
ShortNamespaceLines == R.ShortNamespaceLines &&
SortIncludes == R.SortIncludes &&
SortJavaStaticImport == R.SortJavaStaticImport &&
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -311,6 +311,9 @@
- Improved C++20 Modules and Coroutines support.
+- Added ``SeparateDefinitionBlocks`` option, to insert or remove blank lines
+ between definition blocks.
+
libclang
--------
Index: clang/docs/ClangFormatStyleOptions.rst
===================================================================
--- clang/docs/ClangFormatStyleOptions.rst
+++ clang/docs/ClangFormatStyleOptions.rst
@@ -3192,15 +3192,15 @@
**PenaltyBreakFirstLessLess** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for breaking before the first ``<<``.
+**PenaltyBreakOpenParenthesis** (``Unsigned``) :versionbadge:`clang-format 14`
+ The penalty for breaking after ``(``.
+
**PenaltyBreakString** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for each line break introduced inside a string literal.
**PenaltyBreakTemplateDeclaration** (``Unsigned``) :versionbadge:`clang-format 7`
The penalty for breaking after template declaration.
-**PenaltyBreakOpenParenthesis** (``Unsigned``) :versionbadge:`clang-format 14`
- The penalty for breaking after ``(``.
-
**PenaltyExcessCharacter** (``Unsigned``) :versionbadge:`clang-format 3.7`
The penalty for each character outside of the column limit.
@@ -3403,19 +3403,8 @@
* information */
**SeparateDefinitionBlocks** (``SeparateDefinitionStyle``) :versionbadge:`clang-format 14`
- Specifies the use of empty lines to separate definition blocks, including classes,
- structs, enums, and functions.
-
- Possible values:
-
- * ``SDS_Leave`` (in configuration: ``Leave``)
- Leave definition blocks as they are.
-
- * ``SDS_Always`` (in configuration: ``Always``)
- Insert an empty line between definition blocks.
-
- * ``SDS_Never`` (in configuration: ``Never``)
- Remove any empty line between definition blocks.
+ Specifies the use of empty lines to separate definition blocks, including
+ classes, structs, enums, and functions.
.. code-block:: c++
@@ -3461,6 +3450,19 @@
class C {};
}
+ Possible values:
+
+ * ``SDS_Leave`` (in configuration: ``Leave``)
+ Leave definition blocks as they are.
+
+ * ``SDS_Always`` (in configuration: ``Always``)
+ Insert an empty line between definition blocks.
+
+ * ``SDS_Never`` (in configuration: ``Never``)
+ Remove any empty line between definition blocks.
+
+
+
**ShortNamespaceLines** (``Unsigned``) :versionbadge:`clang-format 14`
The maximal number of unwrapped lines that a short namespace spans.
Defaults to 1.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116557.397138.patch
Type: text/x-patch
Size: 3589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220103/fba7255e/attachment.bin>
More information about the cfe-commits
mailing list