zrythm/.clang-format

146 lines
4.3 KiB
YAML

# SPDX-FileCopyrightText: © 2022 Alexandros Theodotou
# SPDX-License-Identifier: FSFAP
---
BasedOnStyle: GNU
---
Language: Cpp
AccessModifierOffset: -2
# FIXME set to BlockIndent on clang-format 14
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: Left
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: DontAlign
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: TopLevel
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: MultiLine
AttributeMacros: ['COLD', 'NONNULL_ARGS', 'NONNULL', 'HOT', 'WARN_UNUSED_RESULT', 'PURE']
BinPackArguments: true
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
# This is often beneficial to be on a single line
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: true
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: true
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: false
ContinuationIndentWidth: 2
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: false
ForEachMacros:
- LILV_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"(zrythm-|zrythm-test-)config\.h"$'
Priority: -10
CaseSensitive: true
- Regex: '^<(windows|shlobj).h>$'
Priority: -6
CaseSensitive: false
- Regex: '^<(assert|errno|inttypes|signal|string|std.+|sys/.+|math)\.h>$'
Priority: -2
CaseSensitive: true
- Regex: '^"((audio|actions|dsp|io|plugins|settings|utils|gui|schemas)/.*|zrythm\.h|zrythm_app\.h|project\.h)'
Priority: 3
CaseSensitive: true
- Regex: '^<(((glib|gtk)/.*)|adwaita|glib|libpanel)\.h>$'
Priority: 4
- Regex: '^"(tests|helpers)/.*"$'
Priority: 5
- Regex: '.*'
Priority: 6
# don't use main includes
IncludeIsMainRegex: '^$'
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: AfterExternBlock
IndentGotoLabels: false
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
MaxEmptyLinesToKeep: 1
PenaltyBreakAssignment: 30
PenaltyBreakBeforeFirstCallParameter: 20
PenaltyBreakComment: 300
PenaltyBreakOpenParenthesis: 40
PenaltyBreakString: 1000
PenaltyExcessCharacter: 120
PenaltyIndentedWhitespace: 100
PenaltyReturnTypeOnItsOwnLine: 1
PointerAlignment: Middle
ReferenceAlignment: Right
ReflowComments: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Both
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeParens: Always
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++11
StatementMacros: []
TabWidth: 2
TypenameMacros: []
UseTab: Never
WhitespaceSensitiveMacros:
- G_DEFINE_QUARK
...