97 lines
2.5 KiB
YAML
97 lines
2.5 KiB
YAML
# libuv .clang-format configuration
|
|
# Based on Google C/C++ Style Guide with libuv-specific adaptations
|
|
|
|
BasedOnStyle: Google
|
|
|
|
# Language and standard
|
|
Language: Cpp
|
|
|
|
# Indentation and spacing (2 spaces, no tabs as per CONTRIBUTING.md)
|
|
IndentWidth: 2
|
|
TabWidth: 2
|
|
UseTab: Never
|
|
ContinuationIndentWidth: 4
|
|
IndentCaseLabels: false
|
|
|
|
# Line length (80 characters as per CONTRIBUTING.md)
|
|
ColumnLimit: 80
|
|
|
|
# Alignment and breaking
|
|
AlignAfterOpenBracket: Align
|
|
AlignConsecutiveAssignments: false
|
|
AlignConsecutiveDeclarations: false
|
|
AlignConsecutiveMacros: true
|
|
AlignEscapedNewlines: Right
|
|
AlignOperands: true
|
|
AlignTrailingComments: true
|
|
AllowAllArgumentsOnNextLine: false
|
|
AllowAllConstructorInitializersOnNextLine: false
|
|
AllowAllParametersOfDeclarationOnNextLine: false
|
|
AllowShortBlocksOnASingleLine: false
|
|
AllowShortCaseLabelsOnASingleLine: false
|
|
AllowShortFunctionsOnASingleLine: None
|
|
AllowShortIfStatementsOnASingleLine: false
|
|
AllowShortLoopsOnASingleLine: false
|
|
|
|
# Breaking and wrapping
|
|
AlwaysBreakAfterReturnType: None
|
|
AlwaysBreakBeforeMultilineStrings: false
|
|
AlwaysBreakTemplateDeclarations: false
|
|
BinPackArguments: false
|
|
BinPackParameters: false
|
|
BreakBeforeBinaryOperators: None
|
|
BreakBeforeBraces: Attach
|
|
Cpp11BracedListStyle: true
|
|
BreakBeforeTernaryOperators: true
|
|
BreakConstructorInitializers: BeforeColon
|
|
BreakStringLiterals: true
|
|
|
|
# Spacing
|
|
SpaceAfterCStyleCast: true
|
|
SpaceBeforeAssignmentOperators: true
|
|
SpaceBeforeParens: ControlStatements
|
|
SpaceInEmptyParentheses: false
|
|
SpacesBeforeTrailingComments: 2
|
|
SpacesInAngles: false
|
|
SpacesInCStyleCastParentheses: false
|
|
SpacesInContainerLiterals: true
|
|
SpacesInParentheses: false
|
|
SpacesInSquareBrackets: false
|
|
|
|
# Pointers and references
|
|
PointerAlignment: Left
|
|
DerivePointerAlignment: false
|
|
|
|
# Comments
|
|
ReflowComments: true
|
|
|
|
# Includes
|
|
IncludeBlocks: Preserve
|
|
SortIncludes: false
|
|
|
|
# Penalties for breaking (to control formatting decisions)
|
|
PenaltyBreakAssignment: 2
|
|
PenaltyBreakBeforeFirstCallParameter: 1
|
|
PenaltyBreakComment: 300
|
|
PenaltyBreakFirstLessLess: 120
|
|
PenaltyBreakString: 1000
|
|
PenaltyExcessCharacter: 1000000
|
|
PenaltyReturnTypeOnItsOwnLine: 200
|
|
|
|
# Macros and preprocessor
|
|
IndentPPDirectives: AfterHash
|
|
MacroBlockBegin: ''
|
|
MacroBlockEnd: ''
|
|
|
|
# Enum and macro formatting
|
|
AllowShortEnumsOnASingleLine: false
|
|
SpaceBeforeSquareBrackets: false
|
|
|
|
# Other formatting options
|
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
|
MaxEmptyLinesToKeep: 2
|
|
FixNamespaceComments: false
|
|
|
|
# Function spacing: requiring 2 newlines before functions is not supported by clang-format tool automatically
|
|
SeparateDefinitionBlocks: Leave
|