.clang-format 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright The OpenTelemetry Authors
  2. # SPDX-License-Identifier: Apache-2.0
  3. # See Clang docs: http://clang.llvm.org/docs/ClangFormatStyleOptions.html
  4. BasedOnStyle: Chromium
  5. # Allow double brackets such as std::vector<std::vector<int>>.
  6. Standard: Cpp11
  7. # Indent 2 spaces at a time.
  8. IndentWidth: 2
  9. # Keep lines under 100 columns long.
  10. ColumnLimit: 100
  11. # Always break before braces
  12. BreakBeforeBraces: Custom
  13. BraceWrapping:
  14. # TODO(lujc) wait for clang-format-9 support in Chromium tools
  15. # AfterCaseLabel: true
  16. AfterClass: true
  17. AfterControlStatement: true
  18. AfterEnum: true
  19. AfterFunction: true
  20. AfterNamespace: true
  21. AfterStruct: true
  22. AfterUnion: true
  23. BeforeCatch: true
  24. BeforeElse: true
  25. IndentBraces: false
  26. SplitEmptyFunction: false
  27. SplitEmptyRecord: false
  28. SplitEmptyNamespace: false
  29. # Keeps extern "C" blocks unindented.
  30. AfterExternBlock: false
  31. # Indent case labels.
  32. IndentCaseLabels: true
  33. # Right-align pointers and references
  34. PointerAlignment: Right
  35. # ANGLE likes to align things as much as possible.
  36. AlignOperands: true
  37. AlignConsecutiveAssignments: true
  38. # Use 2 space negative offset for access modifiers
  39. AccessModifierOffset: -2
  40. # TODO(jmadill): Decide if we want this on. Doesn't have an "all or none" mode.
  41. AllowShortCaseLabelsOnASingleLine: false
  42. # Useful for spacing out functions in classes
  43. KeepEmptyLinesAtTheStartOfBlocks: true
  44. # Indent nested PP directives.
  45. IndentPPDirectives: AfterHash
  46. # Include blocks style
  47. IncludeBlocks: Preserve
  48. AttributeMacros:
  49. - OPENTELEMETRY_UNLIKELY
  50. - OPENTELEMETRY_LIKELY
  51. - OPENTELEMETRY_MAYBE_UNUSED
  52. - OPENTELEMETRY_DEPRECATED
  53. - OPENTELEMETRY_API_SINGLETON
  54. - OPENTELEMETRY_LOCAL_SYMBOL
  55. - OPENTELEMETRY_EXPORT
  56. - OPENTELEMETRY_SANITIZER_NO_MEMORY
  57. - OPENTELEMETRY_SANITIZER_NO_THREAD
  58. - OPENTELEMETRY_SANITIZER_NO_ADDRESS