.clang_format 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # .clang-format
  2. BasedOnStyle: LLVM
  3. Language: Cpp
  4. # Black-like "one obvious way"
  5. IndentWidth: 4
  6. TabWidth: 4
  7. UseTab: Never
  8. ColumnLimit: 88
  9. # Keep things broken over lines instead of packed
  10. AllowShortBlocksOnASingleLine: Never
  11. AllowShortCaseLabelsOnASingleLine: false
  12. AllowShortFunctionsOnASingleLine: None
  13. AllowShortIfStatementsOnASingleLine: Never
  14. AllowShortLoopsOnASingleLine: false
  15. BinPackArguments: false
  16. BinPackParameters: false
  17. # Braces & breaking
  18. BreakBeforeBraces: Attach
  19. BreakBeforeBinaryOperators: NonAssignment
  20. ConstructorInitializerAllOnOneLineOrOnePerLine: true
  21. BreakConstructorInitializers: BeforeComma
  22. InsertBraces: true
  23. # No pretty alignment games
  24. AlignOperands: false
  25. AlignConsecutiveAssignments: false
  26. AlignConsecutiveDeclarations: false
  27. DerivePointerAlignment: false
  28. PointerAlignment: Left
  29. # Namespaces & comments
  30. FixNamespaceComments: true
  31. NamespaceIndentation: All
  32. ReflowComments: true
  33. BreakStringLiterals: true
  34. # Deterministic include sorting & grouping (project first, then libs)
  35. SortIncludes: true
  36. IncludeBlocks: Regroup
  37. IncludeIsMainRegex: '(^|.*/)([^/]+)\.(h|hpp)'
  38. IncludeCategories:
  39. - Regex: '^"(app|game|render|tools|ui|engine_core|game_systems|render_gl)/'
  40. Priority: 1
  41. - Regex: '^<Qt/'
  42. Priority: 2
  43. - Regex: '^<GL/|^<OpenGL/'
  44. Priority: 3
  45. - Regex: '^<.*>'
  46. Priority: 4
  47. - Regex: '^".*"'
  48. Priority: 5
  49. # Parens & spacing
  50. SpaceBeforeParens: ControlStatements
  51. SpacesBeforeTrailingComments: 1
  52. # Templates
  53. AlwaysBreakTemplateDeclarations: Yes