diana:diana_codestyle

Code style

To gradually improve the code style in diana, we ask to format all changesets using clang-format (4.0) with these style options:

.clang-format
---
BasedOnStyle: LLVM
Language: Cpp
PointerAlignment: Left
ColumnLimit: 160
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakTemplateDeclarations: true
BreakBeforeBraces: Custom
BraceWrapping:
  AfterClass:      true
  AfterFunction:   true
  AfterStruct:     true
  AfterUnion:      true
BreakConstructorInitializersBeforeComma: true
...

This style configuration should be saved in the diana top-level source-directory as .clang-format.

We suggest using git-clang-format to reformat modified lines:

  • save git-clang-format in your PATH and make it executable
  • if clang-format is not version 4.0, it might necessary to configure git with
    git config  clangFormat.binary clang-format-4.0
  • preview reformatted modifications with
    git clang-format --diff
  • reformat modifications with
    git clang-format -f
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • diana/diana_codestyle.txt
  • Last modified: 2022-05-31 09:29:31
  • (external edit)