.clang-format 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ---
  2. # Language
  3. Language: Cpp
  4. Standard: Cpp11
  5. # Indentation
  6. IndentWidth: 4
  7. ContinuationIndentWidth: 4
  8. AccessModifierOffset: -4
  9. IndentCaseLabels: false
  10. NamespaceIndentation: None
  11. # Spacing
  12. UseTab: Never
  13. SpaceBeforeParens: ControlStatements
  14. SpacesBeforeTrailingComments: 1
  15. SpaceInEmptyParentheses: false
  16. SpacesInAngles: false
  17. SpacesInParentheses: false
  18. SpacesInSquareBrackets: false
  19. SpacesInCStyleCastParentheses: false
  20. SpaceBeforeAssignmentOperators: true
  21. MaxEmptyLinesToKeep: 2
  22. # Alignment
  23. AlignAfterOpenBracket: Align
  24. AlignConsecutiveAssignments: false
  25. AlignConsecutiveDeclarations: false
  26. AlignEscapedNewlinesLeft: true
  27. AlignOperands: true
  28. AlignTrailingComments: true
  29. # Argument Packing
  30. BinPackArguments: true
  31. BinPackParameters: true
  32. # Break handling
  33. ColumnLimit: 100
  34. BreakBeforeBraces: Mozilla
  35. BreakBeforeBinaryOperators: NonAssignment
  36. BreakConstructorInitializersBeforeComma: true
  37. AlwaysBreakTemplateDeclarations: true
  38. ConstructorInitializerAllOnOneLineOrOnePerLine: false
  39. Cpp11BracedListStyle: true
  40. # Break penalities
  41. PenaltyBreakBeforeFirstCallParameter: 200
  42. PenaltyBreakComment: 300
  43. PenaltyBreakFirstLessLess: 120
  44. PenaltyBreakString: 1000
  45. PenaltyExcessCharacter: 5
  46. PenaltyReturnTypeOnItsOwnLine: 60
  47. # Includes
  48. SortIncludes: true
  49. IncludeCategories:
  50. # Match local headers
  51. - Regex: '^"[[:alnum:]_]+\.h"$'
  52. Priority: 1
  53. # Match project headers
  54. - Regex: '^"[[:alnum:]_]+/.+\.h"$'
  55. Priority: 2
  56. # Match Qt headers
  57. - Regex: '^<Q[[:alnum:]_/]+>$'
  58. Priority: 3
  59. # Match other headers
  60. - Regex: '.*'
  61. Priority: 4
  62. # Short blocks
  63. AllowShortBlocksOnASingleLine: false
  64. AllowShortCaseLabelsOnASingleLine: false
  65. AllowShortIfStatementsOnASingleLine: false
  66. AllowShortLoopsOnASingleLine: false
  67. AllowShortFunctionsOnASingleLine: Empty
  68. # Set pointer format
  69. DerivePointerAlignment: false
  70. PointerAlignment: Left
  71. ...