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
- Regex: '^<.*\.h>'
Priority: 2 Priority: 2
- Regex: '^<.*' SortPriority: 0
CaseSensitive: false
- Regex: ^<.*\.h>
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: ^<.*
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: .*
Priority: 3 Priority: 3
# IncludeIsMainRegex: '(Test)?$' SortPriority: 0
# IncludeIsMainSourceRegex: '' CaseSensitive: false
# IndentAccessModifiers: 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
# InsertTrailingCommas: None InsertBraces: false
# JavaScriptQuotes: Leave InsertNewlineAtEOF: false
# JavaScriptWrapImports: true InsertTrailingCommas: None
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: ''
# MacroBlockEnd: ''
# MaxEmptyLinesToKeep: 1
# NamespaceIndentation: None
# PenaltyBreakAssignment: 2
# PenaltyBreakBeforeFirstCallParameter: 19
# PenaltyBreakComment: 300
# PenaltyBreakFirstLessLess: 120
# PenaltyBreakOpenParenthesis: 0
# PenaltyBreakString: 1000
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60
# PenaltyIndentedWhitespace: 0
# PointerAlignment: Right
# PPIndentWidth: -1
# ReferenceAlignment: Pointer
# ReflowComments: true
# RemoveBracesLLVM: false
# SeparateDefinitionBlocks: Leave
# ShortNamespaceLines: 1
# SortIncludes: CaseSensitive
# SortJavaStaticImport: Before
# SortUsingDeclarations: true
# SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
# SpaceBeforeCaseColon: false
# SpaceBeforeCpp11BracedList: false
# SpaceBeforeCtorInitializerColon: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeParensOptions:
# AfterControlStatements: true
# AfterForeachMacros: true
# AfterFunctionDefinitionName: false
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# BeforeNonEmptyParentheses: false
# SpaceAroundPointerQualifiers: Default
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: Never
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
## our comment capitalization at the same time.
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# BitFieldColonSpacing: Both
# StatementAttributeLikeMacros:
# - Q_EMIT
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
TabWidth: 4
# UseCRLF: false
UseTab: Always
# WhitespaceSensitiveMacros:
# - STRINGIZE
# - PP_STRINGIZE
# - BOOST_PP_STRINGIZE
# - NS_SWIFT_NAME
# - CF_SWIFT_NAME
---
### C++ specific config ###
Language: Cpp Language: Cpp
Standard: c++17 LineEnding: DeriveLF
--- MacroBlockBegin: ""
### ObjC specific config ### MacroBlockEnd: ""
Language: ObjC MaxEmptyLinesToKeep: 1
# ObjCBinPackProtocolList: Auto NamespaceIndentation: None
ObjCBlockIndentWidth: 4 ObjCBinPackProtocolList: Never
# ObjCBreakBeforeNestedBlockParam: true ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false ObjCBreakBeforeNestedBlockParam: true
# ObjCSpaceBeforeProtocolList: true ObjCSpaceAfterProperty: false
--- ObjCSpaceBeforeProtocolList: true
### Java specific config ### PPIndentWidth: -1
Language: Java PackConstructorInitializers: NextLine
# BreakAfterJavaFieldAnnotations: false PenaltyBreakAssignment: 2
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax'] PenaltyBreakBeforeFirstCallParameter: 10
... PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
QualifierAlignment: Leave
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- c++
- C++
CanonicalDelimiter: ""
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- 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:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Auto
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE