Skip to content

Commit

Permalink
[clang-format]Update clang formatting settings to insert space into { }.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=286304
<rdar://143321464>

Reviewed by Yusuke Suzuki and Darin Adler.

Per the style guide, empty braces should contain a space:

https://www.webkit.org/code-style-guidelines/

However, `webkit-patch format` collapses the whitespace between curly braces.

We should add the parameter

`SpaceInEmptyBlock : true`

to insert whitespace into empty curly braces.

Documentation:

https://clang.llvm.org/docs/ClangFormatStyleOptions.html

Canonical link: https://commits.webkit.org/289207@main
  • Loading branch information
yulunwu2 authored and darinadler committed Jan 21, 2025
1 parent 0cc94ed commit 7be1151
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyBlock : true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
Expand Down

0 comments on commit 7be1151

Please sign in to comment.