.clang-format 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. ---
  2. Language: Cpp
  3. BasedOnStyle: Google
  4. # Indentation
  5. IndentWidth: 4
  6. TabWidth: 4
  7. UseTab: Never
  8. AccessModifierOffset: -4
  9. IndentCaseLabels: true
  10. IndentPPDirectives: BeforeHash
  11. NamespaceIndentation: None
  12. # Line length
  13. ColumnLimit: 120
  14. # Braces
  15. BreakBeforeBraces: Attach
  16. BraceWrapping:
  17. AfterCaseLabel: false
  18. AfterClass: false
  19. AfterControlStatement: Never
  20. AfterEnum: false
  21. AfterFunction: false
  22. AfterNamespace: false
  23. AfterStruct: false
  24. AfterUnion: false
  25. BeforeCatch: false
  26. BeforeElse: false
  27. BeforeLambdaBody: false
  28. IndentBraces: false
  29. SplitEmptyFunction: false
  30. SplitEmptyRecord: false
  31. SplitEmptyNamespace: false
  32. # Alignment
  33. AlignAfterOpenBracket: Align
  34. AlignConsecutiveAssignments: None
  35. AlignConsecutiveBitFields: None
  36. AlignConsecutiveDeclarations: None
  37. AlignConsecutiveMacros: None
  38. AlignEscapedNewlines: Left
  39. AlignOperands: Align
  40. AlignTrailingComments: true
  41. # Arguments and parameters
  42. AllowAllArgumentsOnNextLine: true
  43. AllowAllParametersOfDeclarationOnNextLine: true
  44. BinPackArguments: true
  45. BinPackParameters: true
  46. # Short forms
  47. AllowShortBlocksOnASingleLine: Empty
  48. AllowShortCaseLabelsOnASingleLine: false
  49. AllowShortEnumsOnASingleLine: false
  50. AllowShortFunctionsOnASingleLine: Inline
  51. AllowShortIfStatementsOnASingleLine: Never
  52. AllowShortLambdasOnASingleLine: All
  53. AllowShortLoopsOnASingleLine: false
  54. # Breaks
  55. AlwaysBreakAfterReturnType: None
  56. AlwaysBreakBeforeMultilineStrings: false
  57. AlwaysBreakTemplateDeclarations: Yes
  58. BreakBeforeBinaryOperators: None
  59. BreakBeforeConceptDeclarations: true
  60. BreakBeforeTernaryOperators: true
  61. BreakConstructorInitializers: BeforeColon
  62. BreakInheritanceList: BeforeColon
  63. BreakStringLiterals: true
  64. # Constructors and initializers
  65. ConstructorInitializerIndentWidth: 4
  66. PackConstructorInitializers: NextLine
  67. # Includes
  68. IncludeBlocks: Regroup
  69. IncludeCategories:
  70. - Regex: '^<.*\.h>'
  71. Priority: 1
  72. - Regex: '^<.*>'
  73. Priority: 2
  74. - Regex: '^".*"'
  75. Priority: 3
  76. SortIncludes: CaseSensitive
  77. # Pointers and references
  78. DerivePointerAlignment: false
  79. PointerAlignment: Left
  80. ReferenceAlignment: Left
  81. # Spaces
  82. SpaceAfterCStyleCast: false
  83. SpaceAfterLogicalNot: false
  84. SpaceAfterTemplateKeyword: true
  85. SpaceAroundPointerQualifiers: Default
  86. SpaceBeforeAssignmentOperators: true
  87. SpaceBeforeCaseColon: false
  88. SpaceBeforeCpp11BracedList: false
  89. SpaceBeforeCtorInitializerColon: true
  90. SpaceBeforeInheritanceColon: true
  91. SpaceBeforeParens: ControlStatements
  92. SpaceBeforeRangeBasedForLoopColon: true
  93. SpaceBeforeSquareBrackets: false
  94. SpaceInEmptyBlock: false
  95. SpaceInEmptyParentheses: false
  96. SpacesBeforeTrailingComments: 2
  97. SpacesInAngles: Never
  98. SpacesInCStyleCastParentheses: false
  99. SpacesInConditionalStatement: false
  100. SpacesInContainerLiterals: false
  101. SpacesInParentheses: false
  102. SpacesInSquareBrackets: false
  103. # Miscellaneous
  104. Cpp11BracedListStyle: true
  105. EmptyLineAfterAccessModifier: Never
  106. EmptyLineBeforeAccessModifier: LogicalBlock
  107. FixNamespaceComments: true
  108. InsertBraces: false
  109. InsertTrailingCommas: None
  110. MaxEmptyLinesToKeep: 1
  111. QualifierAlignment: Leave
  112. ReflowComments: true
  113. SeparateDefinitionBlocks: Leave
  114. SortUsingDeclarations: true
  115. Standard: c++20
  116. ...