naval_swarm/.clang-format
2025-02-03 21:25:04 +01:00

199 lines
5.6 KiB
YAML

---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align # [BlockIndent, Align]
AlignArrayOfStructures: None # [None, Left, Right]
AlignConsecutiveMacros: AcrossComments
AlignConsecutiveAssignments: None # [Consecutive, None]
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false # [InlineOnly, true]
AllowShortLambdasOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
# AllowShortCompoundRequirementOnASingleLine: true # <== clang-format v18+
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BreakAfterAttributes: Leave
AttributeMacros:
- __capability
BinPackArguments: true
BinPackParameters: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None # true
BreakBeforeConceptDeclarations: true
BreakBeforeInheritanceComma: true
BreakInheritanceList: AfterComma
BreakBeforeTernaryOperators: true # false
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: Never
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '(<[0-9a-z_-]*>)'
Priority: 0
SortPriority: 0
CaseSensitive: false
- Regex: '(<gdextension[/0-9a-z_-]*\.h[p]?[p]?>)'
Priority: 2
SortPriority: 3
CaseSensitive: false
- Regex: '(<godot[/0-9a-z_-]*\.h[p]?[p]?>)'
Priority: 2
SortPriority: 4
CaseSensitive: false
- Regex: '(<[0-9a-z_-]*\.h[p]?[p]?>)'
Priority: 1
SortPriority: 1
CaseSensitive: false
- Regex: '(<.+[/0-9a-z_]*\.h[p]?[p]?>)'
Priority: 1
SortPriority: 2
CaseSensitive: false
- Regex: '(".*\.h[p]?[p]?")'
Priority: 3
SortPriority: 5
CaseSensitive: false
- Regex: '(".+[/0-9a-z_]*\.h[p]?[p]?")'
Priority: 3
SortPriority: 6
CaseSensitive: false
IncludeIsMainRegex: '""'
IncludeIsMainSourceRegex: '""'
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentExternBlock: AfterExternBlock
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None # [None, Wrapped] ==> trailing comma insertion cannot be used with bin packing
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 50
PenaltyBreakBeforeFirstCallParameter: 10
PenaltyBreakComment: 50
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 10
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 1000
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 100
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
PPIndentWidth: 2
# QualifierOrder: ['static', 'inline', 'constexpr', 'const', 'type']
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: true
# RemoveParentheses: true ## clang v17 only
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Always # Leave
ShortNamespaceLines: 1
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: Latest
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
- R
...