.clang-format 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. # Available style options are described in https://clang.llvm.org/docs/ClangFormatStyleOptions.html
  2. #
  3. # An easy way to create the .clang-format file is:
  4. #
  5. # clang-format -style=llvm -dump-config > .clang-format
  6. #
  7. Language: Cpp
  8. BasedOnStyle: LLVM
  9. AccessModifierOffset: -1
  10. AlignAfterOpenBracket: Align
  11. AlignArrayOfStructures: None
  12. AlignConsecutiveAssignments:
  13. Enabled: false
  14. AcrossEmptyLines: false
  15. AcrossComments: false
  16. AlignCompound: true
  17. PadOperators: true
  18. AlignConsecutiveBitFields:
  19. Enabled: true
  20. AcrossEmptyLines: false
  21. AcrossComments: false
  22. AlignCompound: true
  23. PadOperators: true
  24. AlignConsecutiveDeclarations:
  25. Enabled: false
  26. AcrossEmptyLines: false
  27. AcrossComments: false
  28. AlignCompound: false
  29. PadOperators: false
  30. AlignConsecutiveMacros:
  31. Enabled: true
  32. AcrossEmptyLines: false
  33. AcrossComments: false
  34. AlignCompound: false
  35. PadOperators: false
  36. AlignConsecutiveShortCaseStatements:
  37. Enabled: false
  38. AcrossEmptyLines: false
  39. AcrossComments: false
  40. AlignCaseColons: false
  41. AlignEscapedNewlines: Left
  42. AlignOperands: Align
  43. AlignTrailingComments:
  44. Kind: Leave
  45. OverEmptyLines: 1
  46. AllowAllArgumentsOnNextLine: false
  47. AllowAllParametersOfDeclarationOnNextLine: false
  48. AllowShortBlocksOnASingleLine: false
  49. AllowShortCaseLabelsOnASingleLine: false
  50. AllowShortEnumsOnASingleLine: false
  51. AllowShortFunctionsOnASingleLine: Inline
  52. AllowShortIfStatementsOnASingleLine: false
  53. AllowShortLambdasOnASingleLine: All
  54. AllowShortLoopsOnASingleLine: false
  55. AlwaysBreakAfterDefinitionReturnType: None
  56. AlwaysBreakAfterReturnType: None
  57. AlwaysBreakBeforeMultilineStrings: false
  58. AlwaysBreakTemplateDeclarations: MultiLine
  59. AttributeMacros:
  60. - __capability
  61. BinPackArguments: true
  62. BinPackParameters: true
  63. BitFieldColonSpacing: Both
  64. BreakBeforeBraces: Custom
  65. BraceWrapping:
  66. AfterCaseLabel: true
  67. AfterClass: true
  68. AfterControlStatement: Always
  69. AfterEnum: true
  70. AfterExternBlock: false
  71. AfterFunction: true
  72. AfterNamespace: true
  73. AfterObjCDeclaration: true
  74. AfterStruct: true
  75. AfterUnion: true
  76. BeforeCatch: true
  77. BeforeElse: true
  78. BeforeLambdaBody: false
  79. BeforeWhile: false
  80. IndentBraces: false
  81. SplitEmptyFunction: true
  82. SplitEmptyRecord: true
  83. SplitEmptyNamespace: true
  84. BreakAfterAttributes: Never
  85. BreakAfterJavaFieldAnnotations: false
  86. BreakArrays: false
  87. BreakBeforeBinaryOperators: None
  88. BreakBeforeConceptDeclarations: Always
  89. BreakBeforeInlineASMColon: OnlyMultiline
  90. BreakBeforeTernaryOperators: true
  91. BreakConstructorInitializers: AfterColon
  92. BreakInheritanceList: AfterColon
  93. BreakStringLiterals: true
  94. ColumnLimit: 0
  95. CommentPragmas: "^ IWYU pragma:"
  96. CompactNamespaces: false
  97. ConstructorInitializerIndentWidth: 4
  98. ContinuationIndentWidth: 4
  99. Cpp11BracedListStyle: false
  100. DerivePointerAlignment: false
  101. DisableFormat: false
  102. EmptyLineAfterAccessModifier: Never
  103. EmptyLineBeforeAccessModifier: Always
  104. ExperimentalAutoDetectBinPacking: false
  105. FixNamespaceComments: true
  106. ForEachMacros:
  107. - foreach
  108. - Q_FOREACH
  109. - BOOST_FOREACH
  110. IfMacros:
  111. - KJ_IF_MAYBE
  112. IncludeBlocks: Preserve
  113. IncludeCategories:
  114. - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
  115. Priority: 2
  116. SortPriority: 0
  117. CaseSensitive: false
  118. - Regex: '^(<|"(gtest|gmock|isl|json)/)'
  119. Priority: 3
  120. SortPriority: 0
  121. CaseSensitive: false
  122. - Regex: ".*"
  123. Priority: 1
  124. SortPriority: 0
  125. CaseSensitive: false
  126. IncludeIsMainRegex: "(Test)?$"
  127. IncludeIsMainSourceRegex: ""
  128. IndentAccessModifiers: false
  129. IndentCaseBlocks: false
  130. IndentCaseLabels: false
  131. IndentExternBlock: NoIndent
  132. IndentGotoLabels: true
  133. IndentPPDirectives: None
  134. IndentRequiresClause: true
  135. IndentWidth: 4
  136. IndentWrappedFunctionNames: false
  137. InsertBraces: false
  138. InsertNewlineAtEOF: true
  139. InsertTrailingCommas: None
  140. IntegerLiteralSeparator:
  141. Binary: 0
  142. BinaryMinDigits: 0
  143. Decimal: 0
  144. DecimalMinDigits: 0
  145. Hex: 0
  146. HexMinDigits: 0
  147. JavaScriptQuotes: Leave
  148. JavaScriptWrapImports: true
  149. KeepEmptyLinesAtTheStartOfBlocks: false
  150. KeepEmptyLinesAtEOF: true
  151. LambdaBodyIndentation: Signature
  152. LineEnding: DeriveLF
  153. MacroBlockBegin: ""
  154. MacroBlockEnd: ""
  155. MaxEmptyLinesToKeep: 2
  156. NamespaceIndentation: All
  157. ObjCBinPackProtocolList: Auto
  158. ObjCBlockIndentWidth: 2
  159. ObjCBreakBeforeNestedBlockParam: true
  160. ObjCSpaceAfterProperty: false
  161. ObjCSpaceBeforeProtocolList: true
  162. PackConstructorInitializers: BinPack
  163. PenaltyBreakAssignment: 1000
  164. PenaltyBreakBeforeFirstCallParameter: 19
  165. PenaltyBreakComment: 300
  166. PenaltyBreakFirstLessLess: 120
  167. PenaltyBreakOpenParenthesis: 0
  168. PenaltyBreakString: 1000
  169. PenaltyBreakTemplateDeclaration: 10
  170. PenaltyExcessCharacter: 1000000
  171. PenaltyIndentedWhitespace: 0
  172. PenaltyReturnTypeOnItsOwnLine: 1000
  173. PointerAlignment: Right
  174. PPIndentWidth: 4
  175. QualifierAlignment: Leave
  176. ReferenceAlignment: Pointer
  177. ReflowComments: false
  178. RemoveBracesLLVM: false
  179. RemoveParentheses: Leave
  180. RemoveSemicolon: false
  181. RequiresClausePosition: OwnLine
  182. RequiresExpressionIndentation: OuterScope
  183. SeparateDefinitionBlocks: Leave
  184. ShortNamespaceLines: 1
  185. SortIncludes: Never
  186. SortJavaStaticImport: Before
  187. SortUsingDeclarations: LexicographicNumeric
  188. SpaceAfterCStyleCast: false
  189. SpaceAfterLogicalNot: false
  190. SpaceAfterTemplateKeyword: true
  191. SpaceAroundPointerQualifiers: Both
  192. SpaceBeforeAssignmentOperators: true
  193. SpaceBeforeCaseColon: false
  194. SpaceBeforeCpp11BracedList: false
  195. SpaceBeforeCtorInitializerColon: true
  196. SpaceBeforeInheritanceColon: true
  197. SpaceBeforeJsonColon: false
  198. SpaceBeforeParens: ControlStatements
  199. SpaceBeforeParensOptions:
  200. AfterControlStatements: true
  201. AfterForeachMacros: true
  202. AfterFunctionDefinitionName: false
  203. AfterFunctionDeclarationName: false
  204. AfterIfMacros: true
  205. AfterOverloadedOperator: false
  206. AfterRequiresInClause: false
  207. AfterRequiresInExpression: false
  208. BeforeNonEmptyParentheses: false
  209. SpaceBeforeRangeBasedForLoopColon: true
  210. SpaceBeforeSquareBrackets: false
  211. SpaceInEmptyBlock: false
  212. SpacesBeforeTrailingComments: 1
  213. SpacesInAngles: Never
  214. SpacesInContainerLiterals: true
  215. SpacesInLineCommentPrefix:
  216. Minimum: 1
  217. Maximum: -1
  218. SpacesInParens: Never
  219. SpacesInParensOptions:
  220. InCStyleCasts: false
  221. InConditionalStatements: false
  222. InEmptyParentheses: false
  223. Other: false
  224. SpacesInSquareBrackets: false
  225. Standard: Latest
  226. StatementAttributeLikeMacros:
  227. - Q_EMIT
  228. StatementMacros:
  229. - Q_UNUSED
  230. - QT_REQUIRE_VERSION
  231. TabWidth: 4
  232. UseTab: Never
  233. VerilogBreakBetweenInstancePorts: true
  234. WhitespaceSensitiveMacros:
  235. - BOOST_PP_STRINGIZE
  236. - CF_SWIFT_NAME
  237. - NS_SWIFT_NAME
  238. - PP_STRINGIZE
  239. - STRINGIZE