.clang-format 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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: 10
  38. # Public open62541 includes starting with "open62541/
  39. - Regex: '^("(open62541)\/)'
  40. Priority: 20
  41. # Internal open62541 includes starting with "ua_" or "open62541_"
  42. - Regex: '^((<|")(([[:alnum:]]+\/)?ua_|open62541_))'
  43. Priority: 30
  44. # All other system header
  45. - Regex: '<[[:alnum:].]+>'
  46. Priority: 40
  47. # The rest
  48. - Regex: '.*'
  49. Priority: 50