[clang] [clang-format] add an option to insert a space only for non-code block empty braces, not for empty parentheses (PR #93634)
Kohei Asano via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 6 23:08:51 PDT 2024
================
@@ -1864,7 +1894,11 @@ FormatStyle getWebKitStyle() {
Style.ObjCSpaceAfterProperty = true;
Style.PointerAlignment = FormatStyle::PAS_Left;
Style.SpaceBeforeCpp11BracedList = true;
- Style.SpaceInEmptyBlock = true;
+ Style.SpaceInEmptyBraces = FormatStyle::SIEBO_Custom;
+ Style.SpaceInEmptyBracesOptions.Block = true;
+ Style.SpaceInEmptyBracesOptions.InitList = true;
+ Style.SpacesInParensOptions.InEmptyParentheses = false;
----------------
khei4 wrote:
I believe this matches, but it might be miss-leading, [check-webkit-style ](https://github.com/WebKit/WebKit/blob/b6db305ef703967e6727c0120b7e46305b02b008/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py#L2384-L2386)script seems like to check whatever empty braces have space. To double check, I will ask in WebKit slack also.
https://github.com/llvm/llvm-project/pull/93634
More information about the cfe-commits
mailing list