Skip to content

Commit

Permalink
New clang-format rules.
Browse files Browse the repository at this point in the history
Essentially, put function parameters in column when long enough, and put
closing parenthesis on the next line. This makes it so the following code
doesn't get glued to the function's signature and is nicer looking.

Formatted some files, not all of them though.
  • Loading branch information
Zylann committed May 1, 2024
1 parent 652386c commit d4fc044
Show file tree
Hide file tree
Showing 61 changed files with 1,284 additions and 524 deletions.
13 changes: 9 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### General config, applies to all languages ###
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignAfterOpenBracket: BlockIndent
# AlignArrayOfStructures: None
# AlignConsecutiveMacros: None
# AlignConsecutiveAssignments: None
Expand All @@ -32,10 +32,11 @@ AllowShortFunctionsOnASingleLine: Empty
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BreakAfterReturnType: Automatic
# AttributeMacros:
# - __capability
# BinPackArguments: true
# BinPackParameters: true
BinPackArguments: false
BinPackParameters: false
#BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
Expand Down Expand Up @@ -119,7 +120,11 @@ KeepEmptyLinesAtTheStartOfBlocks: false
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60

# Original was 60. I increased it after adding `AlignAfterOpenBracket: BlockIndent` and disabling binpacking of
# arguments, because for some reason return types sometimes ended up on their own line, not sure why.
PenaltyReturnTypeOnItsOwnLine: 600

# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
# PPIndentWidth: -1
Expand Down
Loading

0 comments on commit d4fc044

Please sign in to comment.