--- # YAMS C++ Code Style # Based on LLVM style with modifications BasedOnStyle: LLVM Language: Cpp Standard: c++20 # Indentation IndentWidth: 4 TabWidth: 4 UseTab: Never IndentCaseLabels: true IndentCaseBlocks: false NamespaceIndentation: None IndentPPDirectives: None IndentExternBlock: AfterExternBlock IndentGotoLabels: true # Line Length ColumnLimit: 100 # Braces BreakBeforeBraces: Attach BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: Never AfterEnum: false AfterFunction: false AfterNamespace: false AfterStruct: false AfterUnion: false AfterExternBlock: true BeforeCatch: false BeforeElse: false BeforeLambdaBody: false BeforeWhile: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true # Alignment AlignAfterOpenBracket: Align AlignArrayOfStructures: None AlignConsecutiveAssignments: None AlignConsecutiveBitFields: None AlignConsecutiveDeclarations: None AlignConsecutiveMacros: None AlignEscapedNewlines: Right AlignOperands: Align AlignTrailingComments: true # Line Breaking AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: MultiLine BinPackArguments: true BinPackParameters: true BreakBeforeBinaryOperators: None BreakBeforeConceptDeclarations: true BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true # Spaces SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: Never SpacesInCStyleCastParentheses: false SpacesInConditionalStatement: false SpacesInContainerLiterals: false SpacesInParentheses: false SpacesInSquareBrackets: false # Other AccessModifierOffset: -4 CompactNamespaces: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock FixNamespaceComments: true IncludeBlocks: Preserve IndentRequires: false IndentWrappedFunctionNames: false # InsertBraces: false # requires clang-format 15+ # InsertTrailingCommas: None # requires clang-format 15+ KeepEmptyLinesAtTheStartOfBlocks: false # LambdaBodyIndentation: Signature # requires clang-format 15+ MaxEmptyLinesToKeep: 1 PointerAlignment: Left QualifierAlignment: Leave ReferenceAlignment: Pointer ReflowComments: true # RemoveBracesLLVM: false # requires clang-format 15+ # RequiresClausePosition: OwnLine # requires clang-format 15+ # SeparateDefinitionBlocks: Leave # requires clang-format 15+ # ShortNamespaceLines: 1 # requires clang-format 15+ SortIncludes: CaseInsensitive SortUsingDeclarations: true # Penalties (for line breaking decisions) PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakOpenParenthesis: 0 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 60 # Include Categories IncludeCategories: - Regex: '^"yams/' Priority: 1 SortPriority: 1 - Regex: "^" Priority: 5 SortPriority: 5 - Regex: ".*" Priority: 6 SortPriority: 6 # Macros AttributeMacros: - __capability ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IfMacros: - KJ_IF_MAYBE MacroBlockBegin: "" MacroBlockEnd: "" StatementAttributeLikeMacros: - Q_EMIT StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION WhitespaceSensitiveMacros: - STRINGIZE - PP_STRINGIZE - BOOST_PP_STRINGIZE - NS_SWIFT_NAME - CF_SWIFT_NAME