Add clang-format rules

This commit is contained in:
2024-06-09 00:39:46 +02:00
parent 736e5a8974
commit db5648ebc2

50
.clang-format Normal file
View File

@@ -0,0 +1,50 @@
---
BasedOnStyle: WebKit
AccessModifierOffset: "-4"
AlignAfterOpenBracket: Align
AlignEscapedNewlines: Left
AlignOperands: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLoopsOnASingleLine: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
BreakBeforeTernaryOperators: false
BreakInheritanceList: BeforeComma
BreakStringLiterals: false
ColumnLimit: "120"
CommentPragmas: .*
ContinuationIndentWidth: "0"
DerivePointerAlignment: true
EmptyLineBeforeAccessModifier: Always
IncludeBlocks: Merge
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: "4"
IndentWrappedFunctionNames: true
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: "2"
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 20
ReflowComments: false
SortIncludes: Never
SortUsingDeclarations: Never
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyBlock: false
SpacesInAngles: false
SpacesInContainerLiterals: false
Standard: Cpp11
TabWidth: "4"
UseTab: ForIndentation
AllowAllConstructorInitializersOnNextLine: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false