Automatic Code FormattingΒΆ

Note

A pull request will only be accepted if the C++ code is formatted correctly!

  • To have one unified C++ code formatting style, we use clang-format.

  • Clang-format automatically formats source code according to a set of pre-defined rules.

  • Our current style can be found in the .clang-format file file in the root folder of the repository:

 1---
 2BasedOnStyle: LLVM
 3AccessModifierOffset: -4
 4AllowShortBlocksOnASingleLine: Empty
 5AllowShortCaseLabelsOnASingleLine: false
 6AllowShortFunctionsOnASingleLine: Empty
 7AllowShortIfStatementsOnASingleLine: Never
 8AllowShortLoopsOnASingleLine: false
 9AlwaysBreakTemplateDeclarations: Yes
10ColumnLimit: 120
11IndentWidth: 4