Skip to content

Commit e84c485

Browse files
committed
clang-format: Adjust PenaltyBreak* values
These options tell clang-format penalize the formatter for trying to break a long line up on particular elements like assignment, opening brackets, and such. Adjusting these means long lines are broken at more natural places that match existing code. Signed-off-by: Tom Burdick <[email protected]>
1 parent ba3662a commit e84c485

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ IndentGotoLabels: false
101101
IndentWidth: 8
102102
InsertBraces: true
103103
InsertNewlineAtEOF: true
104+
# Control when we break long lines by adjusting the penalty values for breaking on particular code elements
105+
PenaltyBreakAssignment: 120
106+
PenaltyBreakBeforeFirstCallParameter: 100
107+
PenaltyBreakOpenParenthesis: 80
108+
PenaltyBreakString: 100
104109
SpaceBeforeInheritanceColon: False
105110
SpaceBeforeParens: ControlStatementsExceptControlMacros
106111
SortIncludes: Never

0 commit comments

Comments
 (0)