--- BasedOnStyle: LLVM IndentWidth: 4 ColumnLimit: 120 PointerAlignment: Right AlignAfterOpenBracket: AlwaysBreak AllowAllParametersOfDeclarationOnNextLine: false AlwaysBreakBeforeMultilineStrings: true BreakBeforeBinaryOperators: NonAssignment AlignArrayOfStructures: Left BreakBeforeBraces: Linux # never sort includes, only regroup (in rare cases) IncludeBlocks: Regroup SortIncludes: Never # Allow arguments to be on their own lines AllowAllArgumentsOnNextLine: false --- Language: C AlwaysBreakAfterReturnType: AllDefinitions SpaceBeforeParens: Always # we abuse this to make clang-format not touch g_auto* macros, # as these should not have a space inserted before their open bracket WhitespaceSensitiveMacros: ['g_autoptr', 'g_auto', '_', '__attribute__', 'G_DEFINE_QUARK'] --- Language: Cpp Standard: C++11 # format C++11 braced lists like function calls Cpp11BracedListStyle: true # do not put a space before C++11 braced lists SpaceBeforeCpp11BracedList: false # no namespace indentation to keep indent level low NamespaceIndentation: None # we use template< without space. SpaceAfterTemplateKeyword: false # Always break after template declaration AlwaysBreakTemplateDeclarations: true # keep lambda formatting multi-line if not empty AllowShortLambdasOnASingleLine: Empty # return types should not be on their own lines AlwaysBreakAfterReturnType: None PenaltyReturnTypeOnItsOwnLine: 1000 AlwaysBreakAfterDefinitionReturnType: None # Break constructor initializers before the colon and after the commas, # and never put the all in one line. BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon PackConstructorInitializers: Never # Place ternary operators after line breaks BreakBeforeTernaryOperators: true # No own indentation level for access modifiers IndentAccessModifiers: false AccessModifierOffset: -4 # Add empty line only when access modifier starts a new logical block. EmptyLineBeforeAccessModifier: LogicalBlock # Only merge empty functions. AllowShortFunctionsOnASingleLine: Empty # Don't indent case labels. IndentCaseLabels: false # No space after C-style cast SpaceAfterCStyleCast: false # Never pack arguments or parameters BinPackArguments: false BinPackParameters: false # Avoid breaking around an assignment operator PenaltyBreakAssignment: 150 # Left-align newline escapes, e.g. in macros AlignEscapedNewlines: Left # Enums should be one entry per line AllowShortEnumsOnASingleLine: false # we want consecutive macros to be aligned AlignConsecutiveMacros: true