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. 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 &&