.clang-format 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ---
  2. BasedOnStyle: GNU
  3. AccessModifierOffset: -2
  4. Language: Cpp
  5. # If true, aligns consecutive assignments
  6. # Example:
  7. # int aaaa = 12;
  8. # int b = 23;
  9. # int ccc = 23;
  10. AlignConsecutiveAssignments : false
  11. # If true, aligns consecutive declarations
  12. # Example:
  13. # int aaaa = 12;
  14. # float b = 23;
  15. # std::string ccc = 23;
  16. AlignConsecutiveDeclarations: false
  17. # If true, aligns trailing comments
  18. # Example:
  19. # true:
  20. # // Unrelated comment
  21. # void someFunction() {
  22. # doWork(); // Does something
  23. # doMoreWork(); // Does something else
  24. # }
  25. # false:
  26. # // Unrelated comment
  27. # void someFunction() {
  28. # doWork(); // Does something
  29. # doMoreWork(); // Does something else
  30. # }
  31. AlignTrailingComments : true
  32. # Allow putting all parameters of a function
  33. # declaration onto the next line even if
  34. # BinPackParameters is false
  35. # Example:
  36. # true:
  37. # someFunction(foo,
  38. # bar,
  39. # baz);
  40. # false:
  41. # someFunction(foo,bar,baz);
  42. BinPackParameters: false
  43. AllowAllParametersOfDeclarationOnNextLine : true
  44. # Allow contracting simple braced statements to
  45. # a single line
  46. # E.g., this allows if (a) { return; }
  47. # to be put on a single line.
  48. AllowShortBlocksOnASingleLine : true
  49. # If true, short case labels will be contracted
  50. # to a single line
  51. # E.g., this allows
  52. # switch (a) {
  53. # case 1: x = 1; return;
  54. # case 2: x = 2; return;
  55. # default: break
  56. # }
  57. AllowShortCaseLabelsOnASingleLine : false
  58. AllowShortBlocksOnASingleLine: true
  59. AllowShortIfStatementsOnASingleLine: false
  60. AllowShortLoopsOnASingleLine: false
  61. ConstructorInitializerIndentWidth: 4
  62. AlignEscapedNewlinesLeft: false
  63. AllowAllParametersOfDeclarationOnNextLine: true
  64. AlwaysBreakTemplateDeclarations: false
  65. AlwaysBreakBeforeMultilineStrings: false
  66. BreakBeforeBinaryOperators: false
  67. BreakBeforeTernaryOperators: true
  68. BreakConstructorInitializersBeforeComma: false
  69. # If false, a function call’s arguments will either
  70. # be all on the same line or will have one line each.
  71. BinPackArguments : false
  72. ColumnLimit: 60
  73. ConstructorInitializerAllOnOneLineOrOnePerLine: false
  74. DerivePointerBinding: false
  75. ExperimentalAutoDetectBinPacking: false
  76. IndentCaseLabels: false
  77. MaxEmptyLinesToKeep: 1
  78. NamespaceIndentation: None
  79. # ObjCSpaceBeforeProtocolList: true
  80. PenaltyBreakBeforeFirstCallParameter: 19
  81. PenaltyBreakComment: 60
  82. PenaltyBreakString: 1000
  83. PenaltyBreakFirstLessLess: 120
  84. PenaltyExcessCharacter: 1000000
  85. PenaltyReturnTypeOnItsOwnLine: 60
  86. # PointerBindsToType: false
  87. # SpacesBeforeTrailingComments: 1
  88. Cpp11BracedListStyle: false
  89. Standard: Auto
  90. IndentWidth: 4
  91. # # The number of columns used for tab stops.
  92. # TabWidth : 4
  93. # The way to use tab characters in the resulting file.
  94. # Available Options:
  95. # UT_Never : (in configuration: Never)
  96. # Never use tab.
  97. # UT_ForIndentation : (in configuration: ForIndentation)
  98. # Use tabs only for indentation.
  99. # UT_Always : (in configuration: Always)
  100. # Use tabs whenever we need to fill
  101. # whitespace that spans at least from
  102. # one tab stop to the next one.
  103. UseTab : Never
  104. ContinuationIndentWidth: 2
  105. # GNU uses too much space, the rest are inconsistent (they
  106. # attach depending on whether it is a function, class, namespace,etc.)
  107. BreakBeforeBraces : Attach
  108. ...