feat: added clang-format

main
Sara 2024-01-31 21:00:54 +01:00
parent 3c6d113d69
commit 1196708a88
1 changed files with 261 additions and 192 deletions

View File

@ -1,199 +1,268 @@
# Commented out parameters are those with the same value as base LLVM style.
# We can uncomment them if we want to change their value, or enforce the
# chosen value in case the base style changes (last sync: Clang 14.0).
--- ---
### General config, applies to all languages ### BasedOnStyle: Chromium
BasedOnStyle: LLVM
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign AlignAfterOpenBracket: Align
# AlignArrayOfStructures: None AlignArrayOfStructures: None
# AlignConsecutiveMacros: None AlignConsecutiveAssignments:
# AlignConsecutiveAssignments: None Enabled: false
# AlignConsecutiveBitFields: None AcrossEmptyLines: false
# AlignConsecutiveDeclarations: None AcrossComments: false
# AlignEscapedNewlines: Right AlignCompound: false
AlignOperands: DontAlign PadOperators: true
AlignTrailingComments: false AlignConsecutiveBitFields:
# AllowAllArgumentsOnNextLine: true Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseColons: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false
# AllowShortEnumsOnASingleLine: true AllowShortBlocksOnASingleLine: Never
# AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false
# AllowShortCaseLabelsOnASingleLine: false AllowShortEnumsOnASingleLine: true
# AllowShortFunctionsOnASingleLine: All AllowShortFunctionsOnASingleLine: Inline
# AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never
# AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All
# AllowShortLoopsOnASingleLine: false AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false AlwaysBreakBeforeMultilineStrings: true
# AlwaysBreakTemplateDeclarations: MultiLine AlwaysBreakTemplateDeclarations: Yes
# AttributeMacros: AttributeMacros:
# - __capability - __capability
# BinPackArguments: true BinPackArguments: true
# BinPackParameters: true BinPackParameters: false
# BraceWrapping: BitFieldColonSpacing: Both
# AfterCaseLabel: false BraceWrapping:
# AfterClass: false AfterCaseLabel: false
# AfterControlStatement: Never AfterClass: false
# AfterEnum: false AfterControlStatement: Never
# AfterFunction: false AfterEnum: false
# AfterNamespace: false AfterFunction: false
# AfterObjCDeclaration: false AfterNamespace: false
# AfterStruct: false AfterObjCDeclaration: false
# AfterUnion: false AfterStruct: false
# AfterExternBlock: false AfterUnion: false
# BeforeCatch: false AfterExternBlock: false
# BeforeElse: false BeforeCatch: false
# BeforeLambdaBody: false BeforeElse: false
# BeforeWhile: false BeforeLambdaBody: false
# IndentBraces: false BeforeWhile: false
# SplitEmptyFunction: true IndentBraces: false
# SplitEmptyRecord: true SplitEmptyFunction: true
# SplitEmptyNamespace: true SplitEmptyRecord: true
# BreakBeforeBinaryOperators: None SplitEmptyNamespace: true
# BreakBeforeConceptDeclarations: true BreakAfterAttributes: Never
# BreakBeforeBraces: Attach BreakAfterJavaFieldAnnotations: false
# BreakBeforeInheritanceComma: false BreakArrays: true
# BreakInheritanceList: BeforeColon BreakBeforeBinaryOperators: None
# BreakBeforeTernaryOperators: true BreakBeforeBraces: Attach
# BreakConstructorInitializersBeforeComma: false BreakBeforeConceptDeclarations: Always
BreakConstructorInitializers: AfterColon BreakBeforeInlineASMColon: OnlyMultiline
# BreakStringLiterals: true BreakBeforeTernaryOperators: true
ColumnLimit: 0 BreakConstructorInitializers: BeforeColon
# CommentPragmas: '^ IWYU pragma:' BreakInheritanceList: BeforeColon
# QualifierAlignment: Leave BreakStringLiterals: true
# CompactNamespaces: false ColumnLimit: 80
ConstructorInitializerIndentWidth: 8 CommentPragmas: "^ IWYU pragma:"
ContinuationIndentWidth: 8 CompactNamespaces: false
Cpp11BracedListStyle: false ConstructorInitializerIndentWidth: 4
# DeriveLineEnding: true ContinuationIndentWidth: 4
# DerivePointerAlignment: false Cpp11BracedListStyle: true
# DisableFormat: false DerivePointerAlignment: false
# EmptyLineAfterAccessModifier: Never DisableFormat: false
# EmptyLineBeforeAccessModifier: LogicalBlock EmptyLineAfterAccessModifier: Never
# ExperimentalAutoDetectBinPacking: false EmptyLineBeforeAccessModifier: LogicalBlock
# PackConstructorInitializers: BinPack ExperimentalAutoDetectBinPacking: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true FixNamespaceComments: true
# AllowAllConstructorInitializersOnNextLine: true ForEachMacros:
# FixNamespaceComments: true - foreach
# ForEachMacros: - Q_FOREACH
# - foreach - BOOST_FOREACH
# - Q_FOREACH IfMacros:
# - BOOST_FOREACH - KJ_IF_MAYBE
# IfMacros: IncludeBlocks: Preserve
# - KJ_IF_MAYBE
# IncludeBlocks: Preserve
IncludeCategories: IncludeCategories:
- Regex: '".*"' - Regex: ^<ext/.*\.h>
Priority: 1 Priority: 2
- Regex: '^<.*\.h>' SortPriority: 0
Priority: 2 CaseSensitive: false
- Regex: '^<.*' - Regex: ^<.*\.h>
Priority: 3 Priority: 1
# IncludeIsMainRegex: '(Test)?$' SortPriority: 0
# IncludeIsMainSourceRegex: '' CaseSensitive: false
# IndentAccessModifiers: false - Regex: ^<.*
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: .*
Priority: 3
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: ([-_](test|unittest))?$
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true IndentCaseLabels: true
# IndentCaseBlocks: false IndentExternBlock: AfterExternBlock
# IndentGotoLabels: true IndentGotoLabels: true
# IndentPPDirectives: None IndentPPDirectives: None
# IndentExternBlock: AfterExternBlock IndentRequiresClause: true
# IndentRequires: false IndentWidth: 4
IndentWidth: 4 IndentWrappedFunctionNames: false
# IndentWrappedFunctionNames: false InsertBraces: false
# InsertTrailingCommas: None InsertNewlineAtEOF: false
# JavaScriptQuotes: Leave InsertTrailingCommas: None
# JavaScriptWrapImports: true IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtEOF: false
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtTheStartOfBlocks: false
# LambdaBodyIndentation: Signature LambdaBodyIndentation: Signature
# MacroBlockBegin: '' Language: Cpp
# MacroBlockEnd: '' LineEnding: DeriveLF
# MaxEmptyLinesToKeep: 1 MacroBlockBegin: ""
# NamespaceIndentation: None MacroBlockEnd: ""
# PenaltyBreakAssignment: 2 MaxEmptyLinesToKeep: 1
# PenaltyBreakBeforeFirstCallParameter: 19 NamespaceIndentation: None
# PenaltyBreakComment: 300 ObjCBinPackProtocolList: Never
# PenaltyBreakFirstLessLess: 120 ObjCBlockIndentWidth: 2
# PenaltyBreakOpenParenthesis: 0 ObjCBreakBeforeNestedBlockParam: true
# PenaltyBreakString: 1000 ObjCSpaceAfterProperty: false
# PenaltyBreakTemplateDeclaration: 10 ObjCSpaceBeforeProtocolList: true
# PenaltyExcessCharacter: 1000000 PPIndentWidth: -1
# PenaltyReturnTypeOnItsOwnLine: 60 PackConstructorInitializers: NextLine
# PenaltyIndentedWhitespace: 0 PenaltyBreakAssignment: 2
# PointerAlignment: Right PenaltyBreakBeforeFirstCallParameter: 10
# PPIndentWidth: -1 PenaltyBreakComment: 300
# ReferenceAlignment: Pointer PenaltyBreakFirstLessLess: 120
# ReflowComments: true PenaltyBreakOpenParenthesis: 0
# RemoveBracesLLVM: false PenaltyBreakString: 1000
# SeparateDefinitionBlocks: Leave PenaltyBreakTemplateDeclaration: 10
# ShortNamespaceLines: 1 PenaltyExcessCharacter: 1000000
# SortIncludes: CaseSensitive PenaltyIndentedWhitespace: 0
# SortJavaStaticImport: Before PenaltyReturnTypeOnItsOwnLine: 200
# SortUsingDeclarations: true PointerAlignment: Left
# SpaceAfterCStyleCast: false QualifierAlignment: Leave
# SpaceAfterLogicalNot: false RawStringFormats:
# SpaceAfterTemplateKeyword: true - Language: Cpp
# SpaceBeforeAssignmentOperators: true Delimiters:
# SpaceBeforeCaseColon: false - cc
# SpaceBeforeCpp11BracedList: false - CC
# SpaceBeforeCtorInitializerColon: true - cpp
# SpaceBeforeInheritanceColon: true - Cpp
# SpaceBeforeParens: ControlStatements - CPP
# SpaceBeforeParensOptions: - c++
# AfterControlStatements: true - C++
# AfterForeachMacros: true CanonicalDelimiter: ""
# AfterFunctionDefinitionName: false BasedOnStyle: google
# AfterFunctionDeclarationName: false - Language: TextProto
# AfterIfMacros: true Delimiters:
# AfterOverloadedOperator: false - pb
# BeforeNonEmptyParentheses: false - PB
# SpaceAroundPointerQualifiers: Default - proto
# SpaceBeforeRangeBasedForLoopColon: true - PROTO
# SpaceInEmptyBlock: false EnclosingFunctions:
# SpaceInEmptyParentheses: false - EqualsProto
# SpacesBeforeTrailingComments: 1 - EquivToProto
# SpacesInAngles: Never - PARSE_PARTIAL_TEXT_PROTO
# SpacesInConditionalStatement: false - PARSE_TEST_PROTO
# SpacesInContainerLiterals: true - PARSE_TEXT_PROTO
# SpacesInCStyleCastParentheses: false - ParseTextOrDie
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix - ParseTextProtoOrDie
## our comment capitalization at the same time. - ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDeclarationName: false
AfterFunctionDefinitionName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix: SpacesInLineCommentPrefix:
Minimum: 0 Minimum: 1
Maximum: -1 Maximum: -1
# SpacesInParentheses: false SpacesInParens: Never
# SpacesInSquareBrackets: false SpacesInParensOptions:
# SpaceBeforeSquareBrackets: false InConditionalStatements: false
# BitFieldColonSpacing: Both InCStyleCasts: false
# StatementAttributeLikeMacros: InEmptyParentheses: false
# - Q_EMIT Other: false
# StatementMacros: SpacesInSquareBrackets: false
# - Q_UNUSED Standard: Auto
# - QT_REQUIRE_VERSION StatementAttributeLikeMacros:
TabWidth: 4 - Q_EMIT
# UseCRLF: false StatementMacros:
UseTab: Always - Q_UNUSED
# WhitespaceSensitiveMacros: - QT_REQUIRE_VERSION
# - STRINGIZE TabWidth: 4
# - PP_STRINGIZE UseTab: Never
# - BOOST_PP_STRINGIZE VerilogBreakBetweenInstancePorts: true
# - NS_SWIFT_NAME WhitespaceSensitiveMacros:
# - CF_SWIFT_NAME - BOOST_PP_STRINGIZE
--- - CF_SWIFT_NAME
### C++ specific config ### - NS_SWIFT_NAME
Language: Cpp - PP_STRINGIZE
Standard: c++17 - STRINGIZE
---
### ObjC specific config ###
Language: ObjC
# ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
# ObjCBreakBeforeNestedBlockParam: true
# ObjCSpaceAfterProperty: false
# ObjCSpaceBeforeProtocolList: true
---
### Java specific config ###
Language: Java
# BreakAfterJavaFieldAnnotations: false
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
...