.clang-format 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---
  2. Language: Cpp
  3. BasedOnStyle: llvm
  4. IndentWidth: 4
  5. ColumnLimit: 90
  6. SpacesBeforeTrailingComments: 2
  7. ForEachMacros: [ foreach, LIST_FOREACH, LIST_FOREACH_SAFE ]
  8. DisableFormat: false
  9. # No space between if and parentheses
  10. SpaceBeforeParens: Never
  11. # Format function declarations
  12. BinPackParameters: true
  13. AllowAllParametersOfDeclarationOnNextLine: true
  14. AlignAfterOpenBracket: Align
  15. AlwaysBreakAfterReturnType: All
  16. IndentCaseLabels: true
  17. # Order of includes
  18. IncludeBlocks: Regroup
  19. # Includes are sorted with increasing priority number and then alphabetically
  20. # The first regex which matches is the resulting priority
  21. # We want something like this:
  22. #include <open62541/client_subscriptions.h>
  23. #include <open62541/client_highlevel.h>
  24. #include <open62541/client_config_default.h>
  25. #include <open62541/plugin/log_stdout.h>
  26. #include "server/ua_server_internal.h"
  27. #include "ua_network_tcp.h"
  28. #include "ua_securechannel.h"
  29. #include "ua_types_encoding_binary.h"
  30. #include <check.h>
  31. #include <stdlib.h>
  32. #include "testing_clock.h"
  33. #include "thread_wrapper.h"
  34. IncludeCategories:
  35. # Public open62541 includes starting with <open62541/
  36. - Regex: '^((<|")(open62541)\/)'
  37. Priority: 3
  38. # Internal open62541 includes starting with "ua_" or "open62541_"
  39. - Regex: '^((<|")(([[:alnum:]]+\/)?ua_|open62541_))'
  40. Priority: 4
  41. # All other system header
  42. - Regex: '<[[:alnum:].]+>'
  43. Priority: 5
  44. # The rest
  45. - Regex: '.*'
  46. Priority: 6