light/.clang-format

136 lines
3.3 KiB
Text
Raw Normal View History

2022-03-06 22:25:23 +03:30
---
# Core
Language: Cpp
2025-07-05 13:28:41 +03:30
Standard: Latest
ColumnLimit: '100'
2022-03-06 22:25:23 +03:30
2025-07-05 13:28:41 +03:30
# Bin pack
BinPackArguments: 'false'
BinPackParameters: 'false'
2022-03-06 22:25:23 +03:30
# Includes
SortIncludes: 'true'
IncludeBlocks: Regroup
IncludeCategories:
2025-07-05 13:28:41 +03:30
# Normal includes
2022-03-06 22:25:23 +03:30
- Regex: '<'
Priority: 500
2025-07-05 13:28:41 +03:30
# Custom include categories...
2022-03-06 22:25:23 +03:30
# C++ includes
- Regex: '[^.h .hpp]>'
Priority: 998
# C includes
- Regex: '<[^/\n]+[.]h>'
Priority: 999
# Braces
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Indentation
UseTab: ForIndentation
TabWidth: '4'
IndentWidth: '4'
ContinuationIndentWidth: '4'
ConstructorInitializerIndentWidth: '4'
IndentCaseLabels: 'false'
IndentWrappedFunctionNames: 'true'
IndentPPDirectives: BeforeHash
NamespaceIndentation: None
AccessModifierOffset: '-4'
# Space
SpaceAfterCStyleCast: 'false'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'false'
SpaceBeforeInheritanceColon: 'false'
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '1'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
2025-07-05 13:28:41 +03:30
# Alignment
PointerAlignment: Right
2022-03-06 22:25:23 +03:30
DerivePointerAlignment: 'false'
AlignEscapedNewlines: Left
2025-07-05 13:28:41 +03:30
AlignAfterOpenBracket: BlockIndent
2022-03-06 22:25:23 +03:30
AlignConsecutiveDeclarations: 'false'
2025-07-05 13:28:41 +03:30
AlignConsecutiveAssignments: 'false'
2022-03-06 22:25:23 +03:30
AlignConsecutiveMacros: 'true'
AlignOperands: 'true'
AlignTrailingComments: 'true'
2025-07-05 13:28:41 +03:30
# Single Line
2022-03-06 22:25:23 +03:30
AllowShortCaseLabelsOnASingleLine: 'true'
2025-07-05 13:28:41 +03:30
AllowShortFunctionsOnASingleLine: 'false'
2022-03-06 22:25:23 +03:30
AllowShortLambdasOnASingleLine: Inline
AllowAllArgumentsOnNextLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortIfStatementsOnASingleLine: Never
2025-07-05 13:28:41 +03:30
# Break
2022-03-06 22:25:23 +03:30
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
2025-07-05 13:28:41 +03:30
BreakBeforeBinaryOperators: All
2022-03-06 22:25:23 +03:30
BreakBeforeTernaryOperators: 'false'
BreakInheritanceList: BeforeComma
2025-07-05 13:28:41 +03:30
BreakStringLiterals: 'true'
2022-03-06 22:25:23 +03:30
# Penalties
2025-07-05 13:28:41 +03:30
PenaltyBreakAssignment: '99999'
2022-03-06 22:25:23 +03:30
PenaltyBreakBeforeFirstCallParameter: '0'
PenaltyBreakComment: '0'
PenaltyBreakFirstLessLess: '0'
PenaltyBreakString: '0'
PenaltyBreakTemplateDeclaration: '0'
2025-07-05 13:28:41 +03:30
PenaltyExcessCharacter: '999999999'
2022-03-06 22:25:23 +03:30
PenaltyReturnTypeOnItsOwnLine: '999999999' # Nope
# Constructor Initializers
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
2025-07-05 13:28:41 +03:30
AllowAllConstructorInitializersOnNextLine: 'false'
2022-03-06 22:25:23 +03:30
BreakConstructorInitializers: BeforeComma
# Comments
2025-07-05 13:28:41 +03:30
ReflowComments: 'true'
2022-03-06 22:25:23 +03:30
FixNamespaceComments: 'true'
# Misc
Cpp11BracedListStyle: 'false'
SortUsingDeclarations: 'true'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
MaxEmptyLinesToKeep: '2'
2025-07-05 13:28:41 +03:30
ExperimentalAutoDetectBinPacking: false