cuberite/.clang-format

101 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

---
Language: Cpp
BasedOnStyle: LLVM
ColumnLimit: 120
UseTab: ForContinuationAndIndentation
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
IndentCaseLabels: true
IndentWidth: 4
# Spacing rules
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
# # Ensure spaces after commas
# SpaceAfterComma: true
# Bracing and alignment
# BreakBeforeBraces: Allman
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortCaseExpressionOnASingleLine: true
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
AlignOperands: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignTrailingComments: false
AlignAfterOpenBracket: BlockIndent
# Function declarations
BinPackParameters: false
AllowShortFunctionsOnASingleLine: Inline
AllowAllParametersOfDeclarationOnNextLine: false
ExperimentalAutoDetectBinPacking: false
# Line breaks
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: true
AtStartOfFile: true
MaxEmptyLinesToKeep: 5
# Misc
AllowAllArgumentsOnNextLine: false
BinPackArguments: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterComma
PackConstructorInitializers: NextLineOnly
PointerAlignment: Middle
SortIncludes: false
PenaltyReturnTypeOnItsOwnLine: 1000000
InsertNewlineAtEOF: true
# Always include globals first
IncludeCategories:
- Regex: 'Globals.h'
Priority: -1