.clang-format 6.2 KB

  1. BasedOnStyle: Google
  2. # The extra indent or outdent of access modifiers, e.g. public:.
  3. AccessModifierOffset: -4
  4. # If true, aligns escaped newlines as far left as possible. Otherwise puts them into the right-most column.
  5. AlignEscapedNewlinesLeft: false
  6. # If true, aligns trailing comments.
  7. AlignTrailingComments: true
  8. # Allow putting all parameters of a function declaration onto the next line even if BinPackParameters is false.
  9. AllowAllParametersOfDeclarationOnNextLine: false
  10. # If true, if (a) return; can be put on a single line.
  11. AllowShortIfStatementsOnASingleLine: false
  12. # If true, while (true) continue; can be put on a single line.
  13. AllowShortLoopsOnASingleLine: false
  14. AllowShortFunctionsOnASingleLine: true
  15. # If true, always break before multiline string literals.
  16. AlwaysBreakBeforeMultilineStrings: false
  17. # If true, always break after the template<...> of a template declaration.
  18. AlwaysBreakTemplateDeclarations: false
  19. # If false, a function call’s or function definition’s parameters will either all be on the same line or will have one line each.
  20. BinPackParameters: true
  21. # If true, binary operators will be placed after line breaks.
  22. BreakBeforeBinaryOperators: false
  23. # The brace breaking style to use.
  24. # Possible values:
  25. # BS_Attach (in configuration: Attach) Always attach braces to surrounding context.
  26. # BS_Linux (in configuration: Linux) Like Attach, but break before braces on function, namespace and class definitions.
  27. # BS_Stroustrup (in configuration: Stroustrup) Like Attach, but break before function definitions.
  28. # BS_Allman (in configuration: Allman) Always break before braces.
  29. BreakBeforeBraces: Linux
  30. # Always break constructor initializers before commas and align the commas with the colon.
  31. BreakConstructorInitializersBeforeComma: true
  32. # The column limit.
  33. # A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements.
  34. ColumnLimit: 90
  35. # If the constructor initializers don’t fit on a line, put each initializer on its own line.
  36. #ConstructorInitializerAllOnOneLineOrOnePerLine (bool)
  37. # The number of characters to use for indentation of constructor initializer lists.
  38. #ConstructorInitializerIndentWidth (unsigned)
  39. # If true, format braced lists as best suited for C++11 braced lists.
  40. # Important differences: - No spaces inside the braced list. - No line break before the closing brace. - Indentation with the continuation indent, not with the block indent.
  41. # Fundamentally, C++11 braced lists are formatted exactly like function calls would be formatted in their place. If the braced list follows a name (e.g. a type or variable name), clang-format formats as if the {} were the parentheses of a function call with that name. If there is no name, a zero-length name is assumed.
  42. Cpp11BracedListStyle: true
  43. # If true, analyze the formatted file for the most common binding.
  44. #DerivePointerBinding (bool)
  45. # If true, clang-format detects whether function calls and definitions are formatted with one parameter per line.
  46. # Each call can be bin-packed, one-per-line or inconclusive. If it is inconclusive, e.g. completely on one line, but a decision needs to be made, clang-format analyzes whether there are other bin-packed cases in the input file and act accordingly.
  47. # NOTE: This is an experimental flag, that might go away or be renamed. Do not use this in config files, etc. Use at your own risk.
  48. #ExperimentalAutoDetectBinPacking (bool)
  49. # Indent case labels one level from the switch statement.
  50. # When false, use the same indentation level as for the switch statement. Switch statement body is always indented one level more than case labels.
  51. IndentCaseLabels: false
  52. # If true, indent when breaking function declarations which are not also definitions after the type.
  53. #IndentFunctionDeclarationAfterType (bool)
  54. # The number of characters to use for indentation.
  55. IndentWidth: 4
  56. # The maximum number of consecutive empty lines to keep.
  57. MaxEmptyLinesToKeep: 1
  58. # The indentation used for namespaces.
  59. # Possible values:
  60. # NI_None (in configuration: None) Don’t indent in namespaces.
  61. # NI_Inner (in configuration: Inner) Indent only in inner namespaces (nested in other namespaces).
  62. # NI_All (in configuration: All) Indent in all namespaces.
  63. NamespaceIndentation: None
  64. # Add a space in front of an Objective-C protocol list, i.e. use Foo <Protocol> instead of Foo<Protocol>.
  65. #ObjCSpaceBeforeProtocolList (bool)
  66. # The penalty for each line break introduced inside a comment.
  67. #PenaltyBreakComment (unsigned)
  68. # The penalty for breaking before the first <<.
  69. #PenaltyBreakFirstLessLess (unsigned)
  70. # The penalty for each line break introduced inside a string literal.
  71. #PenaltyBreakString (unsigned)
  72. # The penalty for each character outside of the column limit.
  73. #PenaltyExcessCharacter (unsigned)
  74. # Penalty for putting the return type of a function onto its own line.
  75. #PenaltyReturnTypeOnItsOwnLine (unsigned)
  76. # Set whether & and * bind to the type as opposed to the variable.
  77. #PointerBindsToType: false
  78. # If true, spaces will be inserted between ‘for’/’if’/’while’/... and ‘(‘.
  79. #SpaceAfterControlStatementKeyword: true
  80. # If false, spaces will be removed before ‘=’, ‘+=’, etc.
  81. #SpaceBeforeAssignmentOperators: true
  82. # If false, spaces may be inserted into ‘()’.
  83. #SpaceInEmptyParentheses: false
  84. # The number of spaces to before trailing line comments.
  85. #SpacesBeforeTrailingComments (unsigned)
  86. # If false, spaces may be inserted into C style casts.
  87. #SpacesInCStyleCastParentheses (bool)
  88. # If true, spaces will be inserted after every ‘(‘ and before every ‘)’.
  89. SpacesInParentheses: false
  90. # Format compatible with this standard, e.g. use A<A<int> > instead of A<A<int>> for LS_Cpp03.
  91. # Possible values:
  92. # LS_Cpp03 (in configuration: Cpp03) Use C++03-compatible syntax.
  93. # LS_Cpp11 (in configuration: Cpp11) Use features of C++11 (e.g. A<A<int>> instead of A<A<int> >).
  94. # LS_Auto (in configuration: Auto) Automatic detection based on the input.
  95. Standard: Cpp11
  96. # If true, IndentWidth consecutive spaces will be replaced with tab characters.
  97. UseTab: false
  98. # vim: ft=yaml